-
Notifications
You must be signed in to change notification settings - Fork 2k
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
connector[connectorName] is not a function #22
Comments
@lacker Yeah, GraphQL error messages aren't easy to debug. The line and column numbers actually correspond to the query. So whatever field is on the second line of your query has a resolve function which throws that error. From the looks of it the error is from some code that tries to initialize connectors. Are you passing any connectors to Apollo Server, and are they constructors? If not, that might be the problem. If that doesn't help you solve it, you can pass the following function as the
PS: We have a PR that should improve error messages in GraphQL. We hope it will make it into GraphQL-JS soon. |
Mmmm ok I found it. Yeah I really just want the stack trace when something goes wrong, at least when I am running in development mode. That is e.g. how Rails does it. Even if it's just printed out by the server. |
Agreed. We should make this the default behavior for Apollo Server when no |
Hi, I have the same error, could you explain how to fix them? |
BTW there's an issue open for the stack trace thing if anyone wants to look at it: #111 |
Thank's you. I'm new in Apollo, so I try apollo server in Meteor application and my configuration was
like show the documentation, and I think the connector was my Meteor collection, My assumption was wrong. Now looks this way
|
@wzalazar for connectors, are you passing in an object with string keys, eg. |
If anyone need an example, Meteor + Apollo, I created an repository https://github.com/wzalazar/graphql-meteor |
* Initial commit * Add .npmignore to avoid ignoring lib when publishing * 0.0.2 * Update graphql-extensions dependency to 0.0.2 * 0.0.3 * Reorganize code and add tests * 0.0.4 * Add tests and reorganize code * 0.0.5 * Update dependency to graphql-extensions 0.0.4 * 0.0.6 * Update graphql-extensions dependency and downgrade TS target * 0.0.7 * Update README * Update README * Update README * Update README * Add import instructions for TypeScript to README (#7) * Add cache hints when the directive is defined on interfaces (#10) * Increase version range for `graphql` peerDependency. (#12) * 0.0.8 * Update dependencies * 0.0.9 * [apollo-bot] Update the Issue/PR Templates with auto label (#13) * [apollo-bot] Update the Templates with docs label (#15) * Add cache hints to info.cacheControl (#16) This exposes the `cacheControl` hints on the schema, to the resolvers at runtime. * Update `graphql` peer dependency range to allow 0.13.x. * dev: Update TypeScript to latest version, v2.7.2. * dev: Update jest & dependencies to latest versions. * dev: Update type definitions for `graphql`, `node` and `jest`. * dev: Update `graphql` to latest version, v0.13.2. * 0.0.10 * Add defaultMaxAge option This is an easy way to quickly say "I want everything in my schema to be cached for 5 seconds". You can override it with specific maxAges on specific fields or types. An upcoming release of apollo-server-* will allow you to specify options to cacheControl. * Add CircleCI config * Add partial CHANGELOG * 0.1.0 * Honor overwrite default maxAge with maxAge=0 (Fixes #22) (#23) * 0.1.1 * Allow default caching to apply to interfaces * remove unused files * update versions and use a-s style config * run prettier * fix tests and typing
In the same spirit as #2344, this should hopefully _gently_ help us not use types which aren't available in all of the versions of Node.js which we currently target.
In the same spirit as #2344, this should hopefully _gently_ help us not use types which aren't available in all of the versions of Node.js which we currently target.
I'm getting a weird error in initial apollo server setup which seems to be swallowed by the GraphQL layer and it is frustrating because I don't see how I can track it down. I thought all I was doing was roughly copying the example while renaming things, but I must have miscopied something somewhere.
{ "data": { "getUsers": null }, "errors": [ { "message": "connectors[connectorName] is not a function", "locations": [ { "line": 2, "column": 3 } ] } ] }
Line 2, column 3 of what? It is definitely not within my own code. That error is not too helpful. What should I be doing to track this down?
The text was updated successfully, but these errors were encountered: