Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gatsby-demo: error when toggling draft on and off again #783

Closed
DirtyF opened this issue Feb 20, 2020 · 1 comment
Closed

gatsby-demo: error when toggling draft on and off again #783

DirtyF opened this issue Feb 20, 2020 · 1 comment
Labels
contributing Problems related to Tina development

Comments

@DirtyF
Copy link
Contributor

DirtyF commented Feb 20, 2020

Description

Given I am editing a blog post on gatsby demo
When I toggle the draft off and on again
Then the following error is displayed 👇 
Error: useRemarkForm(markdownRemark) 'markdownRemark' was not found on the top node of the graphql query

1. Check if the 'markdownRemark' attribute is included in the GraphQL query. For example:

export const pageQuery = graphql`
  query BlogPostBySlug($slug: String!) {
    markdownRemark(fields: { slug: { eq: $slug } }) {
      ...TinaRemark
      // etc...
    }
 }

2. If you are using an alias, For example:

   export const pageQuery = graphql`
     query BlogPostBySlug($slug: String!) {
       markdownRemark: markdownRemark(fields: { slug: { eq: $slug } }) {
          ...TinaRemark
       // etc...
       }
    }

  then you can optionally use the 'queryName' option to specify a new property in place of 'markdownRemark':

    export const remarkForm(BlogPostTemplate, { queryName: markdownRemark })
`

Expected result

No error when toggling draft status.

Environment

Tinacms Package Versions

current master:

demo-gatsby@1.6.3 /Users/frank/tina/tinacms/packages/demo-gatsby
├── UNMET DEPENDENCY @tinacms/core@^0.7.1
├── UNMET DEPENDENCY @tinacms/fields@^0.5.0
├── UNMET DEPENDENCY @tinacms/form-builder@^0.2.15
├── UNMET DEPENDENCY @tinacms/icons@^0.5.2
├── UNMET DEPENDENCY @tinacms/styles@^0.1.2
├── UNMET DEPENDENCY gatsby-plugin-tinacms@^0.1.24
├── UNMET DEPENDENCY gatsby-tinacms-git@^0.2.19
├── UNMET DEPENDENCY gatsby-tinacms-json@^0.8.8
├── UNMET DEPENDENCY gatsby-tinacms-mdx@^0.0.1
├── UNMET DEPENDENCY gatsby-tinacms-remark@^0.7.3
├── UNMET DEPENDENCY gatsby-tinacms-teams@^0.1.4
├── UNMET DEPENDENCY react-tinacms-blocks@^0.3.1
├── UNMET DEPENDENCY tinacms@^0.13.1

Tools

Tool Version
browser Safari
os 10.15.3
node 12.16.1
npm 6.13.4
@DirtyF DirtyF added the bug Something isn't working label Feb 20, 2020
@ncphillips ncphillips added contributing Problems related to Tina development and removed bug Something isn't working labels Feb 20, 2020
@ncphillips
Copy link
Contributor

I can't reproduce this. I think this has been fixed by that change I made a bit ago.

@DirtyF DirtyF closed this as completed Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributing Problems related to Tina development
Projects
None yet
Development

No branches or pull requests

2 participants