Comments (10)
Thanks a lot for your detailed description, @LawJolla.
I am curious to hear the perspective of @kbrandwijk, @schickling and @freiksenet on this topic 🙂
from graphql-binding.
Thanks @schickling !
Here's the minimal repo. (I kept my development / shared endpoints in the code to make it faster on everyone)
https://github.com/LawJolla/graphql-stitched-bindings-example
from graphql-binding.
Thanks a lot @LawJolla. @timsuchanek will look into this later this week! :)
from graphql-binding.
Awesome, thanks @schickling and @timsuchanek! I should be able to give it a spin today.
from graphql-binding.
I'm currently working on a very similar user case. I would like to know how to control which fields get requested when the function is used without info and some doc about fragmentReplacements
.
If you can point me in the right direction I might be able to add later to docs.
from graphql-binding.
Thanks a lot describing your use case @LawJolla (and apologies for the delayed response). We'll be looking into this over the following days. Can you please provide a minimal repo to reproduce your scenario?
from graphql-binding.
Thanks for the example repo @LawJolla ! One question: Here you're providing a separate schema definition for the stitching. Is there a particular reason to not put this into the schema.graphql
? https://github.com/LawJolla/graphql-stitched-bindings-example/blob/master/mainServer/src/index.js#L76
We're now working on a utility function that will help with your use case
addFragmentToInfo(info: GraphQLResolverInfo, fragment: string): GraphQLResolverInfo
That solves your issue like this:
addFragmentToInfo(idsAndInfo[0].info, 'fragment EnsurePostId on Image { postId }'),
from graphql-binding.
Thanks @timsuchanek , that would be perfect!
I've tried putting the extend type
definition into the schema, but I've always had it kicked back. Maybe I was just doing it wrong. I'll give it a try.
But no, there's no particular reason it's there other than I couldn't get it to work in the schema and Graphql-tools shows that pattern in their old examples.
from graphql-binding.
Re extend type
: If this turns out to be a bug in graphql-import
, please open an issue! This should be a lot simpler this way!
@LawJolla addFragmentToInfo
was merged & released yesterday. Want to give it a shot?
from graphql-binding.
Thanks for your help and I'm sorry for the long delay. I ran into errors and then had other business crap come up.
I finally got back to it and it works great. The only thing that's confusing to me is I wanted to use it as..
const info = addFragmentToInfo(...)
await db.query.type(..., info)
But once I changed it to
await db.query.type(..., addFragmentToInfo(...))
It worked perfectly. Thanks for the help!!
from graphql-binding.
Related Issues (20)
- Support webpack and other bundlers HOT 2
- typescript schema import breaks HOT 6
- Subscriptions are broken on 2.2.2 HOT 1
- Error when calling mutation that is specified inside "extend type Mutation" block HOT 4
- Experiment: using graphql-binding in client-side HOT 5
- Context object not getting sent HOT 2
- Is it possible to use batching? HOT 1
- How to dynamically update the link headers in the binding instance ? HOT 6
- Cannot use Alias with custom binding HOT 2
- [object Object] is returned from a binding when resolver throws an error HOT 14
- method cache and memory leaks HOT 3
- Cannot find module 'graphql/tsutils/Maybe' HOT 5
- mkdirp is not a function HOT 2
- mkdirp race condition HOT 4
- error data from binding is not available HOT 5
- How to write dynamic fragment to use with addFragmentToInfo
- Error with 'fs' and 'module' modules in front end HOT 1
- How can i custom resolves query connection which i expose from "forwardTo" HOT 1
- A new path for graphql-binding - help us decide on the roadmap! HOT 10
- Dependency Dashboard
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-binding.