Closed sajadghawami closed 5 years ago
I don't have any experience with apollo-server version 2, you'll have to apply some basic debugging to the stack trace to figure out what is happening.
(Including the full stack of an error is always helpful)
thank you for the quick reply!
logging the above const schema
gives me the following:
GraphQLSchema {
astNode: undefined,
extensionASTNodes: undefined,
_queryType: Query,
_mutationType: undefined,
_subscriptionType: undefined,
_directives: [ @include, @skip, @deprecated ],
_typeMap:
{ Query: Query,
user: user,
Int: Int,
String: String,
Boolean: Boolean,
Date: Date,
__Schema: __Schema,
__Type: __Type,
__TypeKind: __TypeKind,
__Field: __Field,
__InputValue: __InputValue,
__EnumValue: __EnumValue,
__Directive: __Directive,
__DirectiveLocation: __DirectiveLocation },
_implementations: {},
_possibleTypeMap: undefined,
__validationErrors: undefined,
__allowedLegacyNames: [] }
which obviously seems to be the problem.
thats the stack-trace:
TypeError: Cannot read property 'replace' of undefined
at normalize (/backend/node_modules/graphql-tag/lib/graphql-tag.umd.js:14:17)
at parseDocument (/backend/node_modules/graphql-tag/lib/graphql-tag.umd.js:129:18)
at gql (/backend/node_modules/graphql-tag/lib/graphql-tag.umd.js:176:10)
at Object.<anonymous> (/backend/src/app.js:45:13)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Module.require (module.js:585:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/backend/src/bin/www:11:13)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3
No part of the stack trace goes through graphql-sequelize, have you verified the issue is actually with attributeFields? Does the error not occur if you manually define userType
?
Thanks for your help, i striped out apollo for now and this seems to work!
Hey guys,
so i am trying to get apollo-server v2 to work with the
field helper
to useattributeFields
. I used this before:which worked just fine.
Now, using the following syntax:
Gives me
TypeError: Cannot read property 'replace' of undefined
.Any help would be appreciated! Thanks in advance :)