Comments (5)
That's an interesting point, but not sure how it could be done.
From the top of my mind, if you query the gateway, it won't let you know about subgraph and this is intended.
You could potentially query all subgraphs and put together information, but won't be effective I suspect. I feel the only way would be to manually put together all the schema files and follow where the schema is extended, evaluating apollo specific directives. It feels hard.
From a consumer perspective, I am not sure about the value provided, as the consumer actually should be aware of the backend (federated or not, and how it's being federated). From a tooling perspective, it could help but not sure to which extent 🤔
from graphql-voyager.
It is actually more difficult, you have an SDL and an API. You can see that concept in the seldom known apollo workbench. It holds also information about the name of the subgraphs. In the example the LOCATIONS subgraph is shown. So there is a graph with information on what graphs are available and which field in which graph is external and in which not, it is only one hell of AST crawling away ;)
https://www.apollographql.com/docs/federation/v1/workbench/overview#view-supergraph-and-api-schemas
from graphql-voyager.
That's an interesting point, but not sure how it could be done.
From the top of my mind, if you query the gateway, it won't let you know about subgraph and this is intended. You could potentially query all subgraphs and put together information, but won't be effective I suspect. I feel the only way would be to manually put together all the schema files and follow where the schema is extended, evaluating apollo specific directives. It feels hard.
From a consumer perspective, I am not sure about the value provided, as the consumer actually should be aware of the backend (federated or not, and how it's being federated). From a tooling perspective, it could help but not sure to which extent 🤔
I guess you could use https://the-guild.dev/graphql/tools/docs/api/modules/merge_src to merge multiple .graphql files into one before using it into voyager
from graphql-voyager.
I guess you could use https://the-guild.dev/graphql/tools/docs/api/modules/merge_src to merge multiple .graphql files into one before using it into voyager
I depends what you aim or look for. Reading files is ok, but if you then generate an SDL you are gonna be stuck because the SDL will not contain any info. An option is to read the sdl field from each subgraph which. would return the unparsed copy of the sdl. Still, you need to decide what to do with that and how to inject additional info on the UI
from graphql-voyager.
https://github.com/apollographql/supergraph-demo-fed2/blob/main/supergraph/schema/docker.graphql
looking at that example, it really sounds like a nightmare :D
from graphql-voyager.
Related Issues (20)
- Import from local file instead of cdn in middlewares HOT 1
- Uncaught TypeError: renderVoyager is not a function
- Introducing semantic release HOT 3
- Blank screen when clicking on object type.
- Update example index.html: change init to renderVoyager
- Blank screen when switching between object types, input types, queries and mutations.
- How to use a schema instead of an introspection query in index.html? HOT 2
- Middleware HTML broken in version 2.0.0
- Apollo has changes the support for middleware
- Blank screen with React error when clicking on specific nodes
- Error: Unknown error HOT 1
- Latest NPM publish does not include render-voyager-page.js fix from #357 HOT 7
- Changing Schema with SDL Marks Types and Fields as Deprecated HOT 2
- NPM 2.0.0 version has major code problems HOT 1
- Error resolving dependency for React on npm install
- Voyager Breaks for Huge Schemas
- TypeError: Cannot read properties of undefined (reading 'name') HOT 1
- Support prebuilt SVG graph
- Node 20 is the current LTS
- White screen with error in console: Can not convert data url with MIME type:text/plain;charset=utf8 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 graphql-voyager.