Giter VIP home page Giter VIP logo

graphql-client's Issues

Where to provide headers?

I am using this example To instantiate a client without OAuth2, but here i want to send headers what is the way?

Receiving this error: resulted in a 415 Unsupported Media Type response

Question: The proper way to modify the query with PHP variables?

This is a question, not an issue. I read the documentation, but didn't find an answer for this one. What would be to suggested method for modifying the query with php variables.
Here's an example (which won't work):

$my_additional_parameters = 'extra_foo1
  extra_foo2 {
    more_foo_a
    more_foo_b
  }';

$query = <<<'QUERY'
query GetFooBar($idFoo: String, $idBar: String) {
  foo(id: $idFoo) {
    id_foo
    bar (id: $idBar) {
      id_bar
    }
  $my_additional_parameters
  }
}
QUERY;

I can use mutations?

I need execution this code:

mutation($input: OBT_MOTIVOS_VIAJEEntry!) {
  createOBT_MOTIVO_VIAJE(input: $input) {
    NOMBRE_TIPO_MOTIVO,
    DESCRIPCION_TIPO_MOTIVO
  }
}

Variables:

{
  "input": {
    "NOMBRE_TIPO_MOTIVO": "mutPE",
    "DESCRIPCION_TIPO_MOTIVO": "mutPE",
    "DIRECCION_IP": "localhost"
  }
}
   

Is possible?

Symfony 6 support

Basically, https://packagist.org/packages/softonic/guzzle-oauth2-middleware needs to be upgraded and psr/cache set to ^1|^2|^3 or maybe drop 1 and go with ^2|^3

Then this library needs a bump, and I guess it will be installable.

composer require softonic/graphql-client

Using version ^1.3 for softonic/graphql-client
./composer.json has been updated
Running composer update softonic/graphql-client
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- softonic/guzzle-oauth2-middleware[1.1.0, ..., 1.3] require psr/cache ^1.0 -> found psr/cache[1.0.0, 1.0.1] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- softonic/graphql-client 1.3.0 requires softonic/guzzle-oauth2-middleware ^1.1 -> satisfiable by softonic/guzzle-oauth2-middleware[1.1.0, ..., 1.3].
- Root composer.json requires softonic/graphql-client ^1.3 -> satisfiable by softonic/graphql-client[1.3.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require softonic/graphql-client:*" to figure out if any version is installable, or "composer require softonic/graphql-client:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

TypeError: Softonic\GraphQL\DataObjectBuilder::build(): Argument #1 ($data) must be of type array, null given

softonic/graphql-client                    2.2.0              Softonic GraphQL client
TypeError: Softonic\GraphQL\DataObjectBuilder::build(): Argument #1 ($data) must be of type array, null given, called in /var/www/html/vendor/softonic/graphql-client/src/DataObjectBuilder.php on line 45 and defined in /var/www/html/vendor/softonic/graphql-client/src/DataObjectBuilder.php:36

Stack trace:

#0 /var/www/html/vendor/softonic/graphql-client/src/DataObjectBuilder.php(45): Softonic\GraphQL\DataObjectBuilder->build(NULL, Array)
#1 /var/www/html/vendor/softonic/graphql-client/src/DataObjectBuilder.php(54): Softonic\GraphQL\DataObjectBuilder->build(Array, Array)
#2 /var/www/html/vendor/softonic/graphql-client/src/DataObjectBuilder.php(45): Softonic\GraphQL\DataObjectBuilder->build(Array, Array)
#3 /var/www/html/vendor/softonic/graphql-client/src/DataObjectBuilder.php(54): Softonic\GraphQL\DataObjectBuilder->build(Array, Array)
#4 /var/www/html/vendor/softonic/graphql-client/src/DataObjectBuilder.php(28): Softonic\GraphQL\DataObjectBuilder->build(Array, Array)
#5 /var/www/html/vendor/softonic/graphql-client/src/ResponseBuilder.php(49): Softonic\GraphQL\DataObjectBuilder->buildQuery(Array)
#6 /var/www/html/vendor/softonic/graphql-client/src/ResponseBuilder.php(20): Softonic\GraphQL\ResponseBuilder->getNormalizedResponse('{"data":{"query...')
#7 /var/www/html/vendor/softonic/graphql-client/src/Client.php(65): Softonic\GraphQL\ResponseBuilder->build(Object(GuzzleHttp\Psr7\Response))
#8 /var/www/html/vendor/softonic/graphql-client/src/Client.php(33): Softonic\GraphQL\Client->executeQuery('query Edits($in...', Array)

Part of response to reproduce:

"images":[{"uuid":"1234567890","url":"url"},null],

Hotfix:
image

Provider Class missing

Hello, I pulled the project down using composer and copy/pasted the getting started code from the documentation, however I am getting the following error:

Fatal error: Uncaught Error: Class 'Softonic\OAuth2\Client\Provider\Softonic' not found

(I am using the composer autoloader to include the files, and other libraries from composer are functioning as expected)

When trying to execute this line:
$provider = new Softonic\OAuth2\Client\Provider\Softonic($options);

Please let me know what the fix for this may be,
Thanks!

Guzzlehttp/guzzle version conflict, required ^6.3, installed ^7.2

Good day!

I have a problem trying to install the library, it marks a conflict with the composer.json since I have installed version 7.2

Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires softonic/graphql-client ^1.2 -> satisfiable by softonic/graphql-client[1.2.0].
- softonic/graphql-client 1.2.0 requires guzzlehttp/guzzle ^6.3 -> found guzzlehttp/guzzle[6.3.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.2).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

How to use token

I send the url but sending the token shows me an error.

Network Error.Client error: `POST http://srvprodweb.kkkka.com:3000/graphql` resulted in a `400 Bad Request` response:
{"errors":[{"message":"Context creation failed: Authentication token is invalid, please log in","extensions":{"code":"UN (truncated...)

My code is this:

$options = [
			'Authorization' => 'Bearer eyJhbGciOiJIUzIpkjlkjljlkjljlkjlkjlklkjlkj1YW5AZW1haWwuY29tIiwiaWQiOiIyNmIzZWQyZC1hYTQzLTQ4YWQtYWQ0My0yNDc4YTQ4MGE4M2IiLCJpYXQiOjE1NTk5Mjk5NDZ9.c6p-yu1jRJ7KJoyj4fBoj_9l_Xz_Y3HBX8D_5tITCns',
		];
		

		$client = \Softonic\GraphQL\ClientBuilder::build('http://srvprodweb.kkkka.com:3000/graphql',$options);

How to use token?

Don't send empty variables

So I'm working with an experimental GraphQL server and I'm doing a simple request with no variables. The request however fails because variables is empty when it should not be sent at all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.