SO作曲家要求记录/graphql-laravel失败 [英] SO composer require rebing/graphql-laravel fails

查看:210
本文介绍了SO作曲家要求记录/graphql-laravel失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试通过 composer 安装 rebing/graphql-laravel 时,我遇到以下问题:

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.

重新运行安装命令:

$ 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.

它失败了!

推荐答案

似乎rebing/graphql-laravel在版本上要求webonyx/graphql-php的版本大于

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

在作曲家文件中似乎还需要webonyx/graphql-php,因此您需要使用以下方式更新子依赖项

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

这篇关于SO作曲家要求记录/graphql-laravel失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆