Coder Social home page Coder Social logo

Comments (9)

chemdrew avatar chemdrew commented on July 30, 2024 1

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.

chemdrew avatar chemdrew commented on July 30, 2024

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.

tonysparks avatar tonysparks commented on July 30, 2024

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.

chemdrew avatar chemdrew commented on July 30, 2024

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.

tonysparks avatar tonysparks commented on July 30, 2024

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.

chemdrew avatar chemdrew commented on July 30, 2024

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.

tonysparks avatar tonysparks commented on July 30, 2024

That could work -- however, that would increase the amount of work significantly (I would need to create POJO's for each schema).

from nodes.

Favorlock avatar Favorlock commented on July 30, 2024

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.

JacobMountain avatar JacobMountain commented on July 30, 2024

@tonysparks @Favorlock Have you looked into GraphQL Braid for schema stitching?

from nodes.

Related Issues (20)

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.