37 I’m using NestJS, TypeORM and GraphQL for my backend API. I’m getting the following error: GraphQLError [Object]: Query root type must be provided. at SchemaValidationContext.reportError (/home/wise-introvert/Container/Projects/the-notebook/app/server/node_modules/graphql/type/validate.js:88:19) at validateRootTypes (/home/wise-introvert/Container/Projects/the-notebook/app/server/node_modules/graphql/type/validate.js:107:13) at validateSchema (/home/wise-introvert/Container/Projects/the-notebook/app/server/node_modules/graphql/type/validate.js:52:3) at graphqlImpl (/home/wise-introvert/Container/Projects/the-notebook/app/server/node_modules/graphql/graphql.js:79:62) at /home/wise-introvert/Container/Projects/the-notebook/app/server/node_modules/graphql/graphql.js:28:59 at new Promise (<anonymous>) at Object.graphql (/home/wise-introvert/Container/Projects/the-notebook/app/server/node_modules/graphql/graphql.js:26:10) at GraphQLSchemaFactory.<anonymous> (/home/wise-introvert/Container/Projects/the-notebook/app/server/node_modules/@nestjs/graphql/dist/schema-builder/graphql-schema.factory.js:49:52) at Generator.next (<anonymous>) at /home/wise-introvert/Container/Projects/the-notebook/app/server/node_modules/tslib/tslib.js:114:75 This is […]
0 I am new to graphql and I would like to build my first API, using mongoose and MongoDB. So far, I’ve built some API’s using Express, mongoose and MongoDB (in MERN apps). I’d like to use Apollo/server , and I realise there are two options to build a server, using startStandaloneServer , therefore not […]
0 I’ve the following schema type Employee { id: UUID! createdAt: Time! updatedAt: Time! lastActivity: Activity } type Activity { id: UUID! createdAt: Time! updatedAt: Time! } extend type Query { Myself: Employee! } The lastActivity may or may not be present of course, but when querying it from my client it throws the following […]
0 how can I attach a variable to a mutation conditionally? I want to create an upsert mutation where the id is generated by the database. So, if the $id variable was set, make an update, otherwise, a creation. I have tried something like this: mutation upsert ( $id: uuid $name: String ) { insert_data_one( […]
0 helpppp, I am making a movie website using Tmdb api built with Nestjs and Graphql as the backend, I wanted to make a patch request that users can upload their ratings for each of the movies, here is the link to the docs for more details: https://developer.themoviedb.org/reference/movie-add-rating, I am using schema first approach with […]
0 I’m trying to test out the apollo graphql codegen for angular. as such I created a net 5 server that hosts Grapqhl endpoint at https://localhost:8081/api/graphql/. It loads fine and no worries. I’ve then created a dummy angular project with apollo graphql in it and installed the code gen as per these two guides: https://www.graphql-code-generator.com/docs/getting-started/installation […]
0 My schema: type Mutation { createOrder(order: OrderDTO!): Order! } type Subscription { onNewOrder(minimumPrice: Float): Order @aws_subscribe(mutations: ["createOrder"]) } My Lambda resolver for createOrder mutation: exports.handler = async function (event: OrderEvent): Promise<OrderWithPrice> { const order = await orderRepository.createOrder(event); … return { …order, totalPrice: await calculateTotalPrice(order) } }; The user should pass minimumPrice parameter on subscription […]
0 I’m trying to use graphiql UI but due of Spring Security, I receive 401. What’s the way to keep /graphql endpoint secured but let /graphiql request to graphql endpoint? I’m on Spring Boot 3.1.4 and Spring For Graphql 1.2.3 If I permitall /graphql it works but I loss security. I Tried also to put […]