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
I'm trying to use this beautiful library in the following code, but it throws an exception:
/Users/xxx/Works/gql/node_modules/graphql/utilities/astFromValue.js:132
throw _iteratorError;
^
TypeError: Cannot convert value to AST: { key: "value" }
at astFromValue (/Users/xxx/Works/gql/node_modules/graphql/utilities/astFromValue.js:195:11)
at astFromValue (/Users/xxx/Works/gql/node_modules/graphql/utilities/astFromValue.js:109:26)
at Object.<anonymous> (/Users/xxx/Works/gql/app.js:73:11)
at Module._compile (internal/modules/cjs/loader.js:738:30)
at loader (/Users/xxx/Works/gql/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/xxx/Works/gql/node_modules/babel-register/lib/node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:630:32)
at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
at Function.Module._load (internal/modules/cjs/loader.js:562:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
Here's the code
import{makeExecutableSchema}from'graphql-tools';importGraphQLJSONfrom'graphql-type-json';import{astFromValue,valueFromAST,isValidJSValue}from'graphql/utilities'consttypeDefs=`scalar JSONtype MyType { extra: JSON}# ...`;constresolvers={JSON: GraphQLJSON,};varschema=makeExecutableSchema({ typeDefs, resolvers });varmyType=schema.getType('Message'varvalue={extra: {'key': 'value'}}// THIS WILL THROW EXCEPTIONSastFromValue(value,myType)
Would you please tell me how to fix this? Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi guys,
I'm trying to use this beautiful library in the following code, but it throws an exception:
Here's the code
Would you please tell me how to fix this? Thanks in advance!
The text was updated successfully, but these errors were encountered: