Comments (9)
Yeah, unfortunately... Let me play with some of the serialization pieces with this in mind and see if there could be a better option
from nodes.
Hi @tonysparks, thanks for the submission!
I'm a little curious on the added value from building queries in this way as opposed to the current API definition. Could you provide some use cases for this?
My main concern is that decoupling the requests from the models and making them so dynamic removes the ability to easily cache them (#2). I would be more inclined to expose the Property tree used to construct the query string in the requestEntity; starting from a base data model and extending it from there.
from nodes.
Hello chemdrew,
My current use case is for schema stitching (i.e., a graphql proxy service the merges multiple disparate graphql services into one).
As an example, a query may come in that has multiple queries that resolve to different backend GraphQL endpoints. It would be nice to be able to construct the (sub)query based on the fields being queried for - which wouldn't be known upfront.
from nodes.
I'm having a hard time understanding how this library plays into schema stitching. Schema stitching is handled by the GraphQL server implementation and the models should all be exposed upfront there; so this client would be able to interface with it as it would any GraphQL API
from nodes.
Sorry, I wasn't very clear.
I'm working on a GraphQL server schema "stitcher". This server, needs to make GraphQL calls to other GraphQL servers. It will receive GraphQL requests, the server then needs to determine which GraphQL servers to call and build the appropriate request (enter in Nodes).
In other words, I'd like to use Nodes on a GraphQL server to call other GraphQL servers, the catch is the requests are not known ahead of time (only the full schema is).
from nodes.
Ah, I had an inkling that's what you were getting at, thanks for clarifying!
I'm still concerned about exposing a way to build an entirely dynamic query but am toying with the idea of exposing the Property tree used to construct the query on the requestEntity.
Would you be able to make use of the Property tree combined with the use of the @GraphQLIgnore annotation?
That way you could build the models for the GraphQL services with each field ignored so you could dynamically populate them but still have it serialized back
from nodes.
That could work -- however, that would increase the amount of work significantly (I would need to create POJO's for each schema).
from nodes.
I can also second the OP's request. Our GraphQL API for the Enjin Coin trusted platform has quite a number of parameter configurations for the various queries and mutations which has been a big headache to support. My solution was (as the OP suggested) and using string replacing on a template to allow dynamic parameters, but it would be nice to have a structured API like what you're working with the ability to dynamically set parameters.
from nodes.
@tonysparks @Favorlock Have you looked into GraphQL Braid for schema stitching?
from nodes.
Related Issues (20)
- How to deserialize a list? HOT 2
- Exception when use gzip compression
- Cannot deserialize value of type `java.time.LocalDateTime` from String \"2020-01-30T13:42:34.400\ HOT 1
- No 'latest' link in Maven tree HOT 1
- Support for Upload
- Runtime generated classes do not serialize correctly
- ObjectMapper uses writeValueAsString()
- Having Multiple Queries in Single Request HOT 1
- Expose Property class for modification
- Problem Deserializing an Empty List
- Support for Directives?
- Fetch uses serializeMapper from ObjectMapperFactory to deserialize
- JCenter/Bintray is being Sunset. Alternative Needed? HOT 3
- bintray repository is missing HOT 5
- American Express <amex/coding>
- GraphQLTemplate possibly not thread safe HOT 3
- Query for same field multiple times HOT 1
- How to response pack as class HOT 1
- Facing issue when the querying an API with single set of fields but returning an array of it.
- Facing issues while querying an API with certain fields but getting an array in response. HOT 3
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 nodes.