birkir / gatsby-source-prismic-graphql

Gatsby source plugin for Prismic GraphQL
MIT License
137 stars 75 forks source link

feat: add parametric fieldName and typeName on plugin options #184

Open bwlt opened 4 years ago

bwlt commented 4 years ago

With this changes a user can decide which fieldName to use and which typeName to use. This commit comes with a new example folder typename-fieldname where this feature can be tested.

The primary motivation of this feature is because of the prismic query size limit (see issue #15). With this changes a user can change the typeName to something smaller than "PRISMIC", like "PRS"; this difference of characters, multiplied the times where on a query is needed to match the fragments (...on PRS_MySliceType on every slice) can reduce the query size.

birkir commented 4 years ago

Is this okay by you?

bwlt commented 4 years ago

No, maybe we have introduced a bug: https://github.com/birkir/gatsby-source-prismic-graphql/pull/184/files?file-filters%5B%5D=.png&file-filters%5B%5D=.ts&file-filters%5B%5D=.tsx#diff-17287dcb0b3d1a60b6b56e8e1ef2337dL216 The diff is too wide, and it have diverged a lot from master 😅 I think it's better close this PR and reopen it in the future