Coder Social home page Coder Social logo

Comments (4)

Leksat avatar Leksat commented on June 12, 2024

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.

vladar avatar vladar commented on June 12, 2024

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.

Leksat avatar Leksat commented on June 12, 2024

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.

vladar avatar vladar commented on June 12, 2024

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)

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.