Skip to content
This repository has been archived by the owner on Nov 3, 2019. It is now read-only.

GraphiQL error with html field #419

Closed
zslabs opened this issue Sep 11, 2019 · 1 comment
Closed

GraphiQL error with html field #419

zslabs opened this issue Sep 11, 2019 · 1 comment

Comments

@zslabs
Copy link

zslabs commented Sep 11, 2019

Describe the bug
Cloning down https://github.com/ChristopherBiscardi/gatsby-starter-mdx-basic running the following on GraphiQL:

query MyQuery {
  allMdx {
    edges {
      node {
        excerpt
        html
      }
    }
  }
}

Returns this:

{
  "errors": [
    {
      "message": "String cannot represent value: { context: { sourceMessage: \"gatsby-plugin-mdx: renderMdxBody was unavailable when rendering html.\\n>> This is a bug.\" }, text: \"gatsby-plugin-mdx: renderMdxBody was unavailable when rendering html.\\n>> This is a bug.\", level: \"ERROR\", stack: [], docsUrl: \"https://gatsby.dev/issue-how-to\" }",
      "locations": [
        {
          "line": 5,
          "column": 9
        }
      ],
      "path": [
        "allMdx",
        "edges",
        0,
        "node",
        "html"
      ],
      "stack": [
        "TypeError: String cannot represent value: { context: { sourceMessage: \"gatsby-plugin-mdx: renderMdxBody was unavailable when rendering html.\\n>> This is a bug.\" }, text: \"gatsby-plugin-mdx: renderMdxBody was unavailable when rendering html.\\n>> This is a bug.\", level: \"ERROR\", stack: [], docsUrl: \"https://gatsby.dev/issue-how-to\" }",
        "    at GraphQLScalarType.serializeString [as serialize] (/Users/zach/Sites/my-mdx-starter2/node_modules/graphql/type/scalars.js:159:9)",
        "    at completeLeafValue (/Users/zach/Sites/my-mdx-starter2/node_modules/graphql/execution/execute.js:641:37)",
        "    at completeValue (/Users/zach/Sites/my-mdx-starter2/node_modules/graphql/execution/execute.js:587:12)",
        "    at /Users/zach/Sites/my-mdx-starter2/node_modules/graphql/execution/execute.js:500:16",
        "    at process._tickCallback (internal/process/next_tick.js:68:7)"
      ]
    },
    {
      "message": "String cannot represent value: { context: { sourceMessage: \"gatsby-plugin-mdx: renderMdxBody was unavailable when rendering html.\\n>> This is a bug.\" }, text: \"gatsby-plugin-mdx: renderMdxBody was unavailable when rendering html.\\n>> This is a bug.\", level: \"ERROR\", stack: [], docsUrl: \"https://gatsby.dev/issue-how-to\" }",
      "locations": [
        {
          "line": 5,
          "column": 9
        }
      ],
      "path": [
        "allMdx",
        "edges",
        1,
        "node",
        "html"
      ],
      "stack": [
        "TypeError: String cannot represent value: { context: { sourceMessage: \"gatsby-plugin-mdx: renderMdxBody was unavailable when rendering html.\\n>> This is a bug.\" }, text: \"gatsby-plugin-mdx: renderMdxBody was unavailable when rendering html.\\n>> This is a bug.\", level: \"ERROR\", stack: [], docsUrl: \"https://gatsby.dev/issue-how-to\" }",
        "    at GraphQLScalarType.serializeString [as serialize] (/Users/zach/Sites/my-mdx-starter2/node_modules/graphql/type/scalars.js:159:9)",
        "    at completeLeafValue (/Users/zach/Sites/my-mdx-starter2/node_modules/graphql/execution/execute.js:641:37)",
        "    at completeValue (/Users/zach/Sites/my-mdx-starter2/node_modules/graphql/execution/execute.js:587:12)",
        "    at /Users/zach/Sites/my-mdx-starter2/node_modules/graphql/execution/execute.js:500:16",
        "    at process._tickCallback (internal/process/next_tick.js:68:7)"
      ]
    }
  ],
  "data": {
    "allMdx": {
      "edges": [
        {
          "node": {
            "html": null
          }
        },
        {
          "node": {
            "html": null
          }
        }
      ]
    }
  }
}

It looks like this was originally added in #164 but maybe there's a regression?

Expected behavior
Returns rendered HTML.

Thanks for any help!

@zslabs
Copy link
Author

zslabs commented Sep 12, 2019

Moved to gatsbyjs/gatsby#17592

@zslabs zslabs closed this as completed Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant