0

I have the following problem trying to install rebing/graphql-laravel via composer:

$ composer require rebing/graphql-laravel
Using version ^2.1 for rebing/graphql-laravel
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for rebing/graphql-laravel ^2.1 -> satisfiable by rebing/graphql-laravel[2.1.0, 2.1.1].
    - Can only install one of: webonyx/graphql-php[v0.12.6, 0.13.x-dev].
    - Can only install one of: webonyx/graphql-php[0.13.x-dev, v0.12.6].
    - Can only install one of: webonyx/graphql-php[0.13.x-dev, v0.12.6].
    - Conclusion: install webonyx/graphql-php 0.13.x-dev
    - Installation request for webonyx/graphql-php 0.12.6 -> satisfiable by webonyx/graphql-php[v0.12.6].


Installation failed, reverting ./composer.json to its original content.

Does anyone knows how to solve this? I need this package to make this query resolver:

<?php

namespace App\GraphQL\Queries;

use Closure;
use App\User;
use Rebing\GraphQL\Support\Facades\GraphQL;
use GraphQL\Type\Definition\ResolveInfo;
use GraphQL\Type\Definition\Type;
use Rebing\GraphQL\Support\Query;
use App\Video;


class Premieres extends Query {

    protected $attributes = [
        'name' => 'Premieres query'
    ];

    public function type(): Type {
        return Type::listOf(GraphQL::type('videos'));
    }

    public function args(): array {
        return [];
    }

    public function resolve($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo, Closure $getSelectFields) {
        return Video::where('shownOnPremieres', 1);
    }
}

I don't know that else to try to solve this. I need to make a query resolver to do some specific queries. Thanks!

After trying one of the proposed solutions:

$ composer update webonyx/graphql-php rebing/graphql-laravel
Package "rebing/graphql-laravel" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: mll-lab/laravel-graphql-playground
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: nuwave/lighthouse
Discovered Package: spatie/laravel-cors
Package manifest generated successfully.

Re-run the installation command:

$ composer require rebing/graphql-laravel -v

Using version ^2.1 for rebing/graphql-laravel
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Dependency resolution completed in 0.103 seconds
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for rebing/graphql-laravel ^2.1 -> satisfiable by rebing/graphql-laravel[2.1.0, 2.1.1].
    - Can only install one of: webonyx/graphql-php[v0.12.6, 0.13.x-dev].
    - Can only install one of: webonyx/graphql-php[0.13.x-dev, v0.12.6].
    - Can only install one of: webonyx/graphql-php[0.13.x-dev, v0.12.6].
    - Conclusion: install webonyx/graphql-php 0.13.x-dev
    - Installation request for webonyx/graphql-php 0.12.6 -> satisfiable by webonyx/graphql-php[v0.12.6].


Installation failed, reverting ./composer.json to its original content.

And it failed!

Matías Magni
  • 313
  • 1
  • 4
  • 19
  • 1
    Try running `composer` with the [`-v` flag](https://getcomposer.org/doc/03-cli.md#global-options) – Phil Oct 14 '19 at 04:50

1 Answers1

2

It seems that rebing/graphql-laravel require webonyx/graphql-php on version more than 0.13.

It seems also that webonyx/graphql-php is already required in your composer file so you need to update the sub-dependency with

composer update webonyx/graphql-php rebing/graphql-laravel

GrenierJ
  • 1,145
  • 8
  • 18
  • Posted it in the article. – Matías Magni Oct 15 '19 at 19:48
  • If you edit directly your `composer.json` by adding `rebing/graphql-laravel: ^2.1` then re-run `composer update webonyx/graphql-php rebing/graphql-laravel` does it give better result ? – GrenierJ Oct 16 '19 at 06:25
  • I've solved it: `"require": { "php": "^7.1.3", "fideloper/proxy": "^4.0", "laravel/framework": "^5.8.0", "laravel/tinker": "^1.0", "mll-lab/laravel-graphql-playground": "^1.1.0", "nuwave/lighthouse": "^4.4.2", "spatie/laravel-cors": "^1.6", "webonyx/graphql-php": "^0.13.8", "rebing/graphql-laravel": "2.1.1" },` But now I'm having this other issue: https://stackoverflow.com/questions/58404470/in-router-php-line-366-argument-1-passed-to-illuminate-routing-routergroup – Matías Magni Oct 16 '19 at 15:06