Replies: 1 comment
-
Any idea anyone ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Preliminary Checks
Description
I have been trying to use Contentful with GraphQL. Working just fine until now. Here is a situation things starts to become complicated.
In Contentful I have a space which contains Entries and all entries basically make up multiple websites.
Microsite (Content Model)
Now these Sites can go upto 20-30 sites. Until here everything is fine.
I created multiple Content Models which make up the website, for eg:
In Gatsby Homepage is generated based on the Unique Code from Microsite Content Model that is passed as a Environment Variable and every content-model which is can be used in the website is added as a entry in the page query. For eg:
Now the challenge here is video, banner and testimonials are just optional components. It may or may not come based on website requirements and allowing this to be a generic solution.
If I do this way. Gatsby starts saying that if a field is optional I need to manually define it and tell gatsby explicitly to create the GraphQL schema. Now if this was a general site then yes I could have done it. But since this is Contentful the explicit way of defining the schema becomes very difficult. Everything has to be defined manually like Asset etc.
Can you help me understand how can this be tackled
Reproduction Link
NA
Steps to Reproduce
NA
Expected Result
Need this to be a generic solution. Even if a fragment remains unused Gatsby shouldn't complain.
Actual Result
A Generic solution.
Environment
Config Flags
No response
Beta Was this translation helpful? Give feedback.
All reactions