Comments (5)
Please not that you should avoid DirectQueries for complex queries. And actually, DirectQueries don't manage field parameters as input types.
In the last commit, I added a specific error message, to precise that.
Consider preparing queries, with parameter as bind variables.
Etienne
from graphql-maven-plugin-project.
Hi Etienne,
Thank you for picking up this item that I reported by e-mail.
I am adding below a dummy query response - for the thread's completeness.
private static final String PJ_QUERY_RESPONSE_DEF = "{" +
" id" +
" time " +
" machine {" +
" id" +
" name" +
" }" +
" jobs { " +
" data " +
"(filter: {" +
" domain: "Mining"" +
" })" +
"{" +
" serviceId" +
" subData {" +
" indicator" +
" id" +
" }" +
" }" +
" }" +
" }";
How should the bind parameters map look like in this situation?
I tried using a prepared query and binding either domain or filter, but the same error message occurs; so maybe I am misusing the API?
Any help would be appreciated.
from graphql-maven-plugin-project.
I reformated your String for better readabilty:
"{id time machine {id name} jobs {data(filter: {domain: "Mining"}){serviceId subData {indicator id}}}}"
The issue here is that the plugin can't currently read the {domain: "Mining"} json part.
So you have to replace the query response by this one:
"{id time machine {id name} jobs {data(filter: ?filterParam){serviceId subData {indicator id}}}}"
This means that there is a Bind Variable of name "filterParam" that must be provided at runtime.
You don't have to provide the map at runtime : the client method allows you to add parameters at the end. The method will create the Map on its own.
These parameters must be couples of values :
- The parameter name (here: "filterParam")
- The parameter value (Here: an object with a "domain" field, whose value is "Mining")
You can see samples in the Forum client project, in the com.graphql_java_generator.samples.forum.client.graphql.PreparedQueries
from graphql-maven-plugin-project.
Hi Etienne,
Thank you for the provided example! It answered my questions!
I consider this Issue Resolved.
Regards,
Amelia
from graphql-maven-plugin-project.
This issue is solved in version 1.2
from graphql-maven-plugin-project.
Related Issues (20)
- Reserved field "null" not correctly parsed with the graphql-maven-plugin HOT 2
- Spring 6 - missing createError() method in OAuthTokenExtractor.GetOAuthTokenClientResponse implementing spring reactive ClientResponse HOT 7
- How to exclude DataFetchers/Controllers in 2.x HOT 6
- Documentation site gone? HOT 1
- Exception while generating Pojos HOT 2
- how bind graphQl respone with implement java class HOT 1
- Parse data even if responses contain errors HOT 8
- graphql-maven-plugin unable to create scalar for custom class HOT 4
- "code too large" compilation error HOT 8
- Missing break statements after VALUE_FALSE in deserialize method HOT 7
- queries on multiple endpoints on the same server HOT 2
- Filed to generate class based on enum HOT 4
- Vulnerable dependency maven:org.codehaus.plexus:plexus-utils:1.5.8 HOT 2
- Java method and params Naming conventions in @GraphQLRepository HOT 1
- Unable to parse variables in GraphQL HOT 14
- Client application fails with springContectBean instantiation error. HOT 1
- Abuse the JSON scalar HOT 4
- Declare plugin thread safe HOT 3
- Error with subscriptions returning enums HOT 3
- Add access token from camel context to the Default Webclient HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-maven-plugin-project.