Can I link gatsby Nodes without knowing the type of the referenced Node? #32207
Unanswered
enikonemeth
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can I link gatsby Nodes without knowing the type of the referenced Node?
I think there is no option now for that.
I have gatsby Nodes sourced from a custom source plugin (I am working on it, too) and in my case there are some reference fields on the contents where I don't know the exact type and I cannot link them because of this.
E.g for a content:
ReferenceToAnother can be null, or any other content (it can be a Folder or a Workspace as well, we don't know it here)
I would like to link the ReferenceToAnother with the referenced content. I have checked the documentation of the schema customization documentation: https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/ It would be easy if this field should be e.g. only a Folder, but in my case this information is missing and it can be also null.
I have also tried schema.buildObjectType as well but the field should contain type as well:
Definition object should contain 'type'
Any idea for solving this problem? I think this is a valid use-case, could you please recommend me another alternatives or could you please think about the the importance of developing a feature without explicitly define the exact type in this case? Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions