Closed seancdavis closed 4 years ago
This can be fixed by specifying the type name and explicitly defining the schema shape for SeoMeta objects.
type SeoMetaOg @infer {
description: String
image: File @fileByRelativePath
title: String
}
type SeoMetaTwitter @infer {
card: String
description: String
image: File @fileByRelativePath
title: String
}
type SeoMeta @infer {
description: String
image: File @fileByRelativePath
og: SeoMetaOg
title: String
twitter: SeoMetaTwitter
}
I'm going to keep this open because I think it would be worthwhile to add this into the starter. Adjusting the tags for the issue, though.
And it should come after #90 is implemented.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This has been solved by explicitly defining types and our schema plugin.
I have a project in which I have multiple models. Let's say they are:
Event
Page
I also have a
twitter
object on theseo
object from which the node is created.The Event model is processed first, and that makes the type of the
twitter
fieldEventSeoTwitter
. That's okay that it's inferred (theoretically), but Gatsby then infers alltwitter
fields asEventSeoTwitter
, regardless of which model they are attached to.Functionally that's okay, but it feels odd.