-
Notifications
You must be signed in to change notification settings - Fork 2k
How to suppress "Resolve function for "xyz" returned undefined" #107
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
Comments
I even set { allowUndefinedInResolve: true } in graphql options and no luck. [EDIT] I see that these options are for the server 1.x. So how to suppress this in 2.x ? |
For 0.2.0 you have to pass the option to |
Thanks for your answer! Is there any documentation to graphql-tools? The documentation from Github points to old version of Apollo Server. |
Right here: http://docs.apollostack.com/graphql-tools/generate-schema.html On Wed, Aug 24, 2016 at 8:18 PM, Tomas Trescak [email protected]
|
Here is what I got so far... https://github.com/payner35/reduxToast But I'm still getting undefined errors
|
@payner35 I'm pretty sure you have to pass that option to |
Thanks @helfer .. working now
|
@helfer I think the documentation is out of date. It still says import { forbidUndefinedInResolve } from 'graphql-tools';
forbidUndefinedInResolve(schema); // TypeError: forbidUndefinedInResolve is not a function Regardless, I can't get any errors to show. I'm trying module.exports = makeExecutableSchema({
typeDefs: schema,
resolvers: require('./resolvers'),
allowUndefinedInResolve: false,
printErrors: true,
logger: {
log: err => {
console.log(err);
}
},
}); And when I run I query I get back: {"errors":[{"message":"Unknown operation named \"undefined\"."}]} But no error is logged either to my terminal nor GraphiQL so I don't know what the issue is. Edit: Nvm, that particular error appears to be a bug in GraphiQL, so Apollo never saw it. My logger is being hit now for other errors, although it's showing up twice now. Oh well. |
Is it possible? I don't care if that field is undefined.
Documentation says that I can enforce this behaviour with "forbidUndefinedInResolve", but I want opposite of that.
http://docs.apollostack.com/apollo-server/errors.html
The text was updated successfully, but these errors were encountered: