hola, seguí un tutorial para GraphQL, ese es el código que escribí hasta ahora:
const express = require('express'); const {graphqlHTTP} = require('express-graphql'); const graphql = require('graphql') const { GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLList, } = graphql; const users = require('./users.json') const app = express(); const userType = new GraphQLObjectType({ name:'User', fields: () => ({ email: { type: GraphQLString}, username: { type: GraphQLString}, name: { type: GraphQLString}, company: { type: GraphQLString}, address: { type: GraphQLString}, }) }) const RootQuery = new GraphQLObjectType({ name:'RootQueryType', fields: () => ({ getAllUsers: { type: new GraphQLList(userType), resolve(parent,args){ return users } } }) }) const Mutation = new GraphQLObjectType({ name:"mutation", fields: () => ({ createUser: { type: userType, args:{ email: { type: GraphQLString}, username: { type: GraphQLString}, name: { type: GraphQLString}, company: { type: GraphQLString}, address: { type: GraphQLString}, }, resolve(parent,args){ users.push({ email: args.email, username: args.usename, name: args.name, company: args.company, adress: args,company, }) return args } } }) }) const schema = new GraphQLSchema({query: RootQuery, mutation: Mutation}) app.use('/graphql', graphqlHTTP({ schema:schema, graphql:true })) app.listen(5000, ()=>{ console.log('server started') })pero cuando llegué a localhost: 5000/graphql en el navegador obtengo: {"errores": [{"mensaje": "Debe proporcionar una cadena de consulta".}]} Traté de verificar que graphqlstring se haya importado correctamente y todo está bien. He buscado mucho, espero que la respuesta esté aquí.