folkloreinc / laravel-graphql

Facebook GraphQL for Laravel 5. It supports Relay, eloquent models, validation and GraphiQL.
1.76k stars 233 forks source link

Could not publish configuration file #385

Open i-mighty opened 6 years ago

i-mighty commented 6 years ago

Following the instructions in the installation guide for Lumen, running php artisan graphql:publish generates an error, In LumenServiceProvider.php line 50: Call to undefined method Folklore\GraphQL\LumenServiceProvider::command()

I installed laravel-graphql 1.1.0

kkomelin commented 6 years ago

Laravel 5.7.7 (clean install) laravel-graphql 1.1.0

I can't publish the config through:

php artisan vendor:publish --provider="Folklore\GraphQL\ServiceProvider"

No errors, just:

Publishing complete.

mfn commented 6 years ago

Laravel 5.7.7 (clean install) laravel-graphql 1.1.0

How did you do this?

The latest 1.1.0 release isn't compatible (composer version constraint) with 5.7, i.e. it won't install?

This is fixed in master but no new release was cut.

kkomelin commented 6 years ago

@mfn Thanks for your prompt reply.

Laravel 5.7.7 (clean install) laravel-graphql 1.1.0

How did you do this?

I just ran composer require folklore/graphql and it set:

"require": {
        "folklore/graphql": "^1.1"
}

From composer.lock:

{
            "name": "folklore/graphql",
            "version": "v1.x-dev",
            "source": {
                "type": "git",
                "url": "https://github.com/Folkloreatelier/laravel-graphql.git",
                "reference": "2c00e91df18ecc827f2f4fac799d1fc50ff8abac"
            },
}
i-mighty commented 6 years ago

It works fine for Laravel but not for Lumen

snaketooth10k commented 6 years ago

I'm getting this issue in Laravel 5.7.

"require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "folklore/graphql": "^1.1.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },

The config file doesn't publish.

sadeghhosseini commented 6 years ago

Same problem here. In Laravel 5.7 the command for publishing package does nothing.

sadeghhosseini commented 6 years ago

I added Folklore\GraphQL\ServiceProvider::class to the config/app.php and then ran the publish command and it worked.

EDIT I just realised that as stated in the README file it supports Laravel >= 5.5.x so it does not support 5.7 yet.

ivanfilatov commented 6 years ago

For 5.7 support use dev-develop version in composer. That worked for me.

ElForastero commented 6 years ago

The same issue on 5.5.40. Update to 5.5.44 solves the problem.

i-mighty commented 6 years ago

Please note that for me it all works well for Laravel but not for Lumen.

budhajeewa commented 6 years ago

I believe (5.7 >= 5.5.x) === true. So not really sure why we have to add Folklore\GraphQL\ServiceProvider::class to the providers array. :thinking:

Still experiencing this error with "folklore/graphql": "^1.1" and "laravel/framework": "5.7.*".

ivanfilatov commented 6 years ago

I believe (5.7 >= 5.5.x) === true. So not really sure why we have to add Folklore\GraphQL\ServiceProvider::class to the providers array. 🤔

Still experiencing this error with "folklore/graphql": "^1.1" and "laravel/framework": "5.7.*".

+1

Traxo7 commented 6 years ago

After clean Lumen install via lumen new blog, and following Lumen instructions:

1- Load the service provider in bootstrap/app.php $app->register(Folklore\GraphQL\LumenServiceProvider::class);

Running graphql:publish gives error:

$ php artisan graphql:publish
In routes.php line 5:
    Call to undefined method Laravel\Lumen\Application::group() 

EDIT:
It works if we use Lumen 5.6:

$ composer create-project laravel/lumen blog "5.6.*"

So I guess error is only on Lumen 5.7?

florianlenz commented 5 years ago

I can confirm @Traxo7 assumption.