Comments (8)
Agreed. We should make this the default behavior for Apollo Server when no formatError
function is provided.
from apollo-server.
@wzalazar for connectors, are you passing in an object with string keys, eg. { 'collection': collection }
. That's the intended usage.
from apollo-server.
@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 formatError
argument to Apollo Server (or a variation thereof which gives you a stack trace or whatever other information you need about the error):
function printError(err){
if(err.originalError){
console.log(err.originalError);
} else {
console.log(err);
}
return err;
}
PS: We have a PR that should improve error messages in GraphQL. We hope it will make it into GraphQL-JS soon.
from apollo-server.
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.
from apollo-server.
Hi, I have the same error, could you explain how to fix them?
from apollo-server.
BTW there's an issue open for the stack trace thing if anyone wants to look at it: #111
from apollo-server.
Thank's you.
I'm new in Apollo, so I try apollo server in Meteor application and my configuration was
const executableSchema = makeExecutableSchema({
typeDefs: Schema,
resolvers: Resolvers,
connectors: Connectors,
});
like show the documentation, and I think the connector was my Meteor collection, My assumption was wrong.
I remove connectors of my configuration and It's works.
Now looks this way
const executableSchema = makeExecutableSchema({
typeDefs: Schema,
resolvers: Resolvers,
});
from apollo-server.
If anyone need an example, Meteor + Apollo, I created an repository https://github.com/wzalazar/graphql-meteor
from apollo-server.
Related Issues (20)
- 'graphqlError.extensions' is possibly 'undefined' in enrichError() HOT 2
- Docs - Inconsistency when wrapping content inside some tables HOT 1
- ENOENT: no such file or directory, open './schema.graphql' HOT 1
- schemaReporter pollTimer has incorrect type HOT 1
- Error from resolver without extensions[V3 was not adding extensions in any error type from resolvers] HOT 2
- Integration of AS4 with graphql-jit not working HOT 3
- Bun integration on subscription (Query and Mutation Works, but not Subscription) HOT 3
- TypeSafe Custom GQLError HOT 2
- support for fastify version 4 HOT 2
- Allow passing http2 server to ApolloServerPluginDrainHttpServer
- ApolloServerPluginUsageReporting reportTimer has incorrect type HOT 1
- Elasticache cluster - CROSSLOT Keys in request don't hash to the same slot HOT 4
- Unable to package/deploy with serverless using Node14 and apollo-serverless-core HOT 3
- ApolloServerPluginUsageReporting does not allow to pass http agent HOT 11
- Misconfigured `sendVariableValues` results in similar behavior as `{all: true}` HOT 3
- ApolloServerPluginUsageReporting does not allow to pass http agent HOT 2
- Apis that have their requests cached dont need to make unnecessary auth token fetches
- Document known mitigated security issue in `@koa/cors` for AS3 users HOT 1
- Update `@koa/cors` dependency for AS3 (or why we don't intend to) HOT 2
- Share and modify variables between Express and the GraphQL/Apollo server HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-server.