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
Trying to use the Optimizely SaaS starter site. In the CMS, I have page type with a property that is a LinkItem. When I generate code, it generates a graphql query for this:
fragment linkPropertyData on linkProperty {
url { ...LinkData }
title
text
target
}
Here is the page that references this fragment:
fragment BasicPageData on BasicPage {
PageBanner { ...BlockData }
PageTitle
BodyText { json, html }
BodyTextCta { ...linkPropertyData }
BodyTextCtaAccessibilityText
MainContent { ...BlockData }
}
But when run 'yarn compile' I get an error that it can't find this fragment:
[FAILED] GraphQL Document Validation failed with 1 errors;
[FAILED] Error 0: Unknown fragment "linkPropertyData".
[FAILED] at C:/Projects/opti-saas-starter/src/components/cms/page/BasicPage/BasicPage.page.graphql:5:20
Does this have to do with the LinkItem itself? Do I need to explicitly import that fragment? Would that get lost the next time I compiled?
Thanks
Ethan
The text was updated successfully, but these errors were encountered:
Hi @ethan-schofer: The Graph-Functions package removes all fragments that are targeting a non-existing types. This allows fragments to be present in a project that are both not used and targeting a non-existing type. The downside is that instead of the expected "Type not present in Graph", you'll see a "Fragment not found" error. Can you verify that the type you're targeting with this fragment is actually present in Graph?
That'll help to pinpoint the actual cause of the error.
Hi
Trying to use the Optimizely SaaS starter site. In the CMS, I have page type with a property that is a LinkItem. When I generate code, it generates a graphql query for this:
fragment linkPropertyData on linkProperty {
url { ...LinkData }
title
text
target
}
Here is the page that references this fragment:
fragment BasicPageData on BasicPage {
PageBanner { ...BlockData }
PageTitle
BodyText { json, html }
BodyTextCta { ...linkPropertyData }
BodyTextCtaAccessibilityText
MainContent { ...BlockData }
}
But when run 'yarn compile' I get an error that it can't find this fragment:
[FAILED] GraphQL Document Validation failed with 1 errors;
[FAILED] Error 0: Unknown fragment "linkPropertyData".
[FAILED] at C:/Projects/opti-saas-starter/src/components/cms/page/BasicPage/BasicPage.page.graphql:5:20
Does this have to do with the LinkItem itself? Do I need to explicitly import that fragment? Would that get lost the next time I compiled?
Thanks
Ethan
The text was updated successfully, but these errors were encountered: