I'm trying to run express server with graphql and I get the following error:
Error: Query.example field type must be Output Type but got: [object Object].
express-graphql used in a route:
app.use('/graphql', graphqlHTTP(req => ({
schema,
pretty: true
})));
The schema looks like that:
export default new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: queries
})
});
Queries has only one query that imported from here:
import {
GraphQLList,
GraphQLID,
GraphQLNonNull
} from 'graphql';
import exampleScheme from '../models/schemes/example';
import {example as exampleData} from '../models/jsons'
export default {
type: exampleScheme,
resolve (root, params, options) {
return exampleData;
}
};
The schemas (exampleScheme) and data (exampleScheme) are working on another project so I assume they're not the problem.
Any ideas? What does 'Output type' mean?