Skip to content
This repository has been archived by the owner on Dec 22, 2018. It is now read-only.

Strings as Objects #19

Open
jserrao opened this issue Nov 2, 2018 · 0 comments
Open

Strings as Objects #19

jserrao opened this issue Nov 2, 2018 · 0 comments

Comments

@jserrao
Copy link

jserrao commented Nov 2, 2018

Strange behavior using this plugin.

I've got a pretty simple query setup to run in one of my components that receives the source data from gatsby-node.js:

  query ($handle: shopifyProductHandleQueryString_2!){
    shopifyProduct(handle: $handle) {
      title
      descriptionHtml
      handle
    }  

Every time I run it, Gatsby throws this error on every node:

Variable "$handle" got invalid value "xyz"; Expected type shopifyProductHandleQueryString_2 to be an object.

How can shopifyProductHandleQueryString_2! be both a string and an object at the same time? When I explore handle in GraphiQL, it looks to be an object of strings.

I can get the query above to work when I play with the GraphiQL query variables pane and feed it a handle object:

{
  "handle": {
    "eq": "my-term-here"
  }
}

Output looks good when I simulate this object like this code just above, but my gatsby-node.js is sending a string back in my application so it bonks. What am I missing here?

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