Привет, я новичок в grapqhl, и ниже мой код схемы:
app.use(bodyParser.json());
app.use ('/ graphql', graphqlHttp ({schema: buildSchema (`type: RootQuery {events: [String] !]!}
type: RootMutation {
createEvent(name: String): String
}
schema {
query: RootQuery
mutation: RootMutation
}
`),
rootValue: {
events: () => {
return ['events','cooking','real'];
},
createEvent: (args) => {
const eventName = args.name;
return eventName
}
},
graphiql: true
})
);