prismicio / gatsby-source-graphql-universal

Plugin for connecting arbitrary GraphQL APIs to Gatsby GraphQL with client side execution
2 stars 6 forks source link

Node type duplication between gatsby-source-prismic-graphql and gatsby-source-graphql-universal #7

Closed heckchuckman closed 4 years ago

heckchuckman commented 4 years ago

Hello,

I'm using @prismicio/gatsby-source-prismic-graphql to interface with our Prismic CMS and I'm attempting to use @prismicio/gatsby-source-graphql-universal to interface with a Magento 2 store.

gatsby-config.js

{
    resolve: "@prismicio/gatsby-source-graphql-universal",
    options: {
        typeName: "MAGENTO",
        fieldName: "magento",
        url: "https://{storeurl}/graphql",
    },
},
{
    resolve: "@prismicio/gatsby-source-prismic-graphql",
    options: {
        repositoryName: "{repo}",
        accessToken:
            "{token}",
        pages: [
            {
                type: "Landing_page",
                match: "/:uid",
                path: "/",
                component: require.resolve(
                    "./src/templates/LandingPage.js"
                ),
            },
        ],
    },
},

Each work properly without the other included. The error response ...

Error: The plugin "@prismicio/gatsby-source-prismic-graphql" created a node of a type owned by another plugin.
          The node type "GraphQLSource" is owned by "@prismicio/gatsby-source-graphql-universal".
          If you copy and pasted code from elsewhere, you'll need to pick a new type name
          for your new node(s).
          The node object passed to "createNode":
          {
      "id": "9f1c17b5-dc2b-5268-ac61-0ab6ef9035c6",
      "typeName": "PRISMIC",
      "fieldName": "prismic",
      "parent": null,
      "children": [],
      "internal": {
          "type": "GraphQLSource",
          "contentDigest": "4b4b7773f1f4e092aec75cdb870af00f",
          "ignoreType": true,
          "counter": 36,
          "owner": "@prismicio/gatsby-source-prismic-graphql"
      }
  }

I've search the documentation but there is no way to change the node type.

Any ideas are welcome! Thanks

heckchuckman commented 4 years ago

Seems related to this issue with gatsby-source-graphql --> https://github.com/gatsbyjs/gatsby/issues/20599#issue

MarcMcIntosh commented 4 years ago

Hi @heckchuckman https://github.com/gatsbyjs/gatsby/issues/20599#issuecomment-574432655 looks like a possible solution :)

MarcMcIntosh commented 4 years ago

Should be fixed in the most recent version 3.4.14