softonic / graphql-client Goto Github PK
View Code? Open in Web Editor NEWPHP Client for GraphQL
License: Other
PHP Client for GraphQL
License: Other
Hi,
Where does the endpoint for authorisation server goes?
Thanks
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
Can you change it to v2? It is still locked to v1.
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;
For compatibility with other client libraries.
For example, Guzzle
uses this interface, and your library uses Guzzle
as a transport. It would be logical to give the Response
as a ResponseInterface
. Or are there special reasons for not doing this?
Add possibility to accept HTTP options http://docs.guzzlephp.org/en/stable/request-options.html
Details can be discussed.
Is there any way to upload files to a GraphQL API using this package?
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?
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.
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],
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!
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.
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?
When sending the request to the server we should allow for someone to override the operationName
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.