hygraph / gatsby-source-graphcms

The official Gatsby source plugin for GraphCMS projects
https://graphcms.com
MIT License
145 stars 41 forks source link

Fix/use correct type names #33

Closed Redmega closed 6 years ago

Redmega commented 6 years ago

Adds a bunch of tests and fixes some pluralization issues

Redmega commented 6 years ago

When this is merged I will publish to the @next tag so we can start testing on example sites w/o ruining anyones days.

Publishing this will mark the release of v1.0.0

Redmega commented 6 years ago

It will be a breaking change since people (I know I am doing this myself) might be relying on our faulty way of getting the type name before (Post became posts singular)

rdela commented 6 years ago

If you can build a site with it I am happy to have you push to npm and try from there, local builds are error below but could be something I am doing.

https://app.netlify.com/sites/kokodokai/deploys/5aa1c954295b550a0ac6aa8c https://github.com/rdela/gatsby-graphcms-rd/tree/canary

rdela commented 6 years ago

vs a successful deploy

https://app.netlify.com/sites/kokodokai/deploys/5aa1976eefbe5d48095be0b4

rdela commented 6 years ago

so I would say it fails on onCreateNode: Artists

rdela commented 6 years ago

any idea why?

rdela commented 6 years ago

Do I have the wrong (non-)plural somewhere now?

Redmega commented 6 years ago

Alright I'll test out on my local in an hour or so

Redmega commented 6 years ago

So all the issues were caused by pluralization assumptions that were wrong.

Apparently, for a given type Artist, its singular within gatsby graphql queries is artist and its plural is allArtist. This is read as "All of type Artist" which makes some kind of sense I guess...

github-actions[bot] commented 4 years ago

:tada: This PR is included in version 0.1.0-next.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: