So the question is literally what the title is. I read the doc about query complexity and still cannot figure out how to do it. I think I might how been able to do it in pure graphql-js since there you can define your root Query type like this:
import { GraphQLList, GraphQLObjectType } from 'graphql';
import { PostObject } from '../objects/post.object';
export const RootQuery = new GraphQLObjectType({
name: 'Query',
extensions: {
complexity: 1
},
fields: () => ({
getPosts: {
type: new GraphQLList(PostObject),
// ...
}
// ...
})
// ...
})
Any comment?So the question is literally what the title is. I read the doc about query complexity and still cannot figure out how to do it. I think I might how been able to do it in pure graphql-js since there you can define your root Query type like this:
import { GraphQLList, GraphQLObjectType } from 'graphql';
import { PostObject } from '../objects/post.object';
export const RootQuery = new GraphQLObjectType({
name: 'Query',
extensions: {
complexity: 1
},
fields: () => ({
getPosts: {
type: new GraphQLList(PostObject),
// ...
}
// ...
})
// ...
})
Any comment?