Comments (4)
I tried to make my idea to work, but it looks like it's too much of work. And the result would look like a hack (in comparison with the current toolkit code).
I think it should be easier for me to adjust the Drupal's schema. I mean switch to GraphQL module version 4 and write custom schema/resolvers.
from gatsby-graphql-toolkit.
Hey, I did a draft of the drupal sourcing using the toolkit here: https://github.com/vladar/gatsby-source-drupal-graphql
But it does create a separate node for each translation using a fragment like this for id:
fragment MyIdFragment on SomeDrupalType {
__typename
entityId
entityLanguage {
id
}
}
from gatsby-graphql-toolkit.
Oh! I thought that the ID fragment should have __typename
plus one ID field. Didn't know that multiple ID fields are allowed. Looks like I misread the docs 🤦
Thanks for the hint!
So I guess this issue can be closed?
BTW, we switched our Drupal Gatsby Toolkit prototype to GraphQL module version 4. And we won't go back to v3 🙂 Here is why: https://github.com/AmazeeLabs/silverback-mono/tree/development/apps/silverback-drupal#why-not-version-3-of-drupal-graphql-module
from gatsby-graphql-toolkit.
We had to update the toolkit to support nested fields in id fragments (as it turned out to be useful). You can use as many fields as needed for gatsby ids.
But keep in mind that for "delta sourcing" you will need to provide all of the id fields and a proper NODE_
query to re-fetch individual translations.
from gatsby-graphql-toolkit.
Related Issues (20)
- feat: display error on 4xx/5xx http error codes HOT 4
- Stale data invalidation with delta syncing
- Add ability to map custom scalar types HOT 2
- Duplicate nodes overwrite unique nodes, resulting in missing Gatsby GraphQL nodes. HOT 1
- Invalid object Node Ids create an unclear error message HOT 1
- Sourcing non-list data HOT 1
- Nullable lists are transformed into non-nullable lists HOT 8
- gatsby 4 - cannot call `createTypes` in the `sourceNodes` API HOT 1
- Toolkit throws TypeError if query returns a non-iterable object
- GraphQL 16 compatibility HOT 2
- Cannot query field HOT 1
- success fetching Nodes, but no Gatsby nodes created. HOT 1
- Accept a function as `gatsbyTypePrefix` .
- Complains about null for non-null type HOT 1
- Fails to execute LIST_ query with NoPagination
- wagtail grapple support
- Import interfaces from source schema
- Cannot query field on type "Query" HOT 1
- LIST does not fetch all data HOT 5
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 gatsby-graphql-toolkit.