prismicio / gatsby-source-prismic-graphql

Gatsby source plugin for Prismic GraphQL
MIT License
17 stars 14 forks source link

Error: Schema must contain uniquely named types but contains multiple types named "DateTime". #15

Closed matthewtgilbride closed 4 years ago

matthewtgilbride commented 4 years ago

Hello,

I suspect this is an issue only when one is starting with an empty prismic repository. I found this issue on the original repo: https://github.com/birkir/gatsby-source-prismic-graphql/issues/121, but the solution there was to create some custom type, and some content, and then the issue is resolved.

That is not the case for me...I created a repo called "empty-repo" and reproduced the problem. Then I added a custom type and some content, but still see the error.

I forked the official sample project and added a commit to demonstrate: https://github.com/matthewtgilbride/gatsby-blog

If you try and run yarn and then yarn start you will see the issue.

Thanks!

matthewtgilbride commented 4 years ago

I was able to fix this in my project by installing gatsby-source-graphql v2.6.2 and adding a resolution in my package.json

"resolutions": {
    "gatsby-source-graphql": "^2.6.2"
}

Additionally, I was able to clone this repo and bump the version, after which all tests passed. Happy to create a PR but I don't have access.

MarcMcIntosh commented 4 years ago

Hi @matthewtgilbride

Thanks for pointing that out, the version bump will need to be done on this repo https://github.com/prismicio/gatsby-source-graphql-universal

Additionally, I was able to clone this repo and bump the version, after which all tests passed. Happy to create a PR but I don't have access

You don't have access?

https://github.com/prismicio/gatsby-source-graphql-universal

MarcMcIntosh commented 4 years ago

@matthewtgilbride did you publish any content?

You could use the theme command and skip adding the types and content :) https://intercom.help/prismicio/en/articles/2933292-sample-blog-with-api-based-cms-gatsby-js

MarcMcIntosh commented 4 years ago

Update to prismicio/gatsbu-source-prismic-graphql has been published :)

matthewtgilbride commented 4 years ago

Thanks :)