This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
fragment preview support #10
Labels
enhancement
New feature or request
Comments
birkir
added
question
Further information is requested
enhancement
New feature or request
and removed
question
Further information is requested
labels
Mar 14, 2019
We should be able to support fragments like the gatsby-source-graphql-universal https://github.com/birkir/gatsby-source-graphql-universal/blob/d743dad75cc9e47e6950e634c3fa8b9292d3e12d/src/index.js#L114 |
Fixed in |
Still not working with Using a Fragment still generates an error with active Preview cookie:
This is the test code, which renders ok when not in Preview mode: import { graphql } from 'gatsby'
import GlobalHome from 'views/global-home/GlobalHome'
export const myFrag = graphql`
fragment MyTestFrag on PRISMIC_Global_home {
title
}
`
export const query = graphql`
query Home {
prismic {
global_home(uid: "home", lang: "en-us") {
... MyTestFrag
}
}
}
`
GlobalHome.query = query
export default GlobalHome |
Confirmed it's working in Good stuff! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there a recommended way of defining GraphQL fragments so that the Apollo client knows about them?
Currently when I defined a fragment in a component like this:
The preview throws this error:
Response:
So it seems as if the fragment is unknown at this point.
Sorry for the storm of new issues. We really hope to use this plugin on a project to enable the preview functionality. I'm reporting what I find and hope it helps someone in the future :)
The text was updated successfully, but these errors were encountered: