You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means that aNewsFeed document contains a date and one element (one of product, post or video).
Ideally I what to use the GraphQL query bellow and fetch my newsfeed ordered by date and containing the applicable newsfeed element with the other elements absent or null.
Need help with null values when using reference fields.
I have a
NewsFeed
schema that contains aProduct
, or aPost
, or aVideo
. Defined as follows:This means that aNewsFeed document contains a date and one element (one of product, post or video).
Ideally I what to use the GraphQL query bellow and fetch my newsfeed ordered by date and containing the applicable newsfeed element with the other elements absent or null.
However I get the following error:
My understating is that GraphQl is trying to load the referenced object even if is not in the current element.
I've already attempted to re-create the newsfeed forcing the elements to be required defaulting to null, with no success. I'm getting the same error
Another option would be refactor the NewsFeed as described bellow. However this will defeat the purpose of simpler GraphQL queries.
Comments? This is a limitation of GraphQL or current Mongoose-GraphQl implementation?
The text was updated successfully, but these errors were encountered: