Tag: typeorm

  • “Column `distinctAlias.post_id` does not exist” Typeorm

    “Column `distinctAlias.post_id` does not exist” Typeorm

    0 I have a posts resolver which uses this logic to return posts: const qb = Post.createQueryBuilder(‘post’) .select([‘post.id AS id’, ‘post.createdAt AS id’]) .addSelect( "json_build_object(‘id’, user.id, ‘username’, user.username, ’email’, user.email, ‘createdAt’, user.createdAt, ‘updatedAt’, user.updatedAt)", ‘creator’ ) if (req.session.userId) qb.addSelect((qb) => { return qb .subQuery() .select(‘updoot.value’) .from(Updoot, ‘updoot’) .where(‘"userId" = :userId AND "postId" = post.id’, {…

  • graphql error: Cannot return null for non-nullable field when calling field in query

    graphql error: Cannot return null for non-nullable field when calling field in query

    0 I am getting this error when I try to query my memberList resolver, It needs to return a membeTypeID but it is returning null – i am using Apollo for this if that helps at all: "errors": [ { "message": "Cannot return null for non-nullable field Member.memberType.", "locations": [ { "line": 5, "column": 3…

  • GraphQLError: Query root type must be provided

    GraphQLError: Query root type must be provided

    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…

  • How to declare Array Of Objects in TypeORM Graphql Schema?

    How to declare Array Of Objects in TypeORM Graphql Schema?

    0 I am working with 2 Postgres Models – users and posts, where each user can have multiple posts (One to Many Relation). Here I need to make a user profile function to access data of single user along with the associated posts. I have made the following schema.ts file for the same – import…

  • Issue with GraphQL and TypeORM – Fetching Products with Images

    Issue with GraphQL and TypeORM – Fetching Products with Images

    0 I’m working on a GraphQL API using TypeORM as the ORM to interact with my PostgreSQL database. I’m currently facing an issue when trying to fetch products along with their associated images using GraphQL queries. I have two tables: products and images. Each product can have multiple images associated with it. The images table…

  • Currently trying to create a graphql resolver mutation for reset Password

    Currently trying to create a graphql resolver mutation for reset Password

    0 I’m facing a unusual error while accessing the reset password button. the error: Uncaught (in promise) ApolloError: error:0200009F:rsa routines::pkcs decoding error can anyone help me with this I’m trying to set the new password when i click the reset password button I’m using typegraphql, typeorm, react reactjs typescript graphql typeorm typegraphql Share Follow asked…

  • GraphQL not showing schema and documentation NestJS

    GraphQL not showing schema and documentation NestJS

    0 I’m working on GraphQL using NestJS and I’ve not created models separately so, in short, I combine them but my GraphQL playground is not showing schemas and documentation of my queries and mutations. GraphQL Config { driver: ApolloDriver, autoSchemaFile: true, path: SERVER_PREFIX_URL, debug: true, playground: true, introspection: true, plugins: [ ApolloServerPluginQueryComplexity({ estimators: [directiveEstimator(), simpleEstimator()],…

  • Issue with GraphQL and TypeORM – Fetching Products with Images

    Issue with GraphQL and TypeORM – Fetching Products with Images

    0 Certainly, here’s a possible Stack Overflow question you could use to get help with your issue: Title: Issue with GraphQL and TypeORM – Fetching Products with Images Description: I’m working on a GraphQL API using TypeORM as the ORM to interact with my PostgreSQL database. I’m currently facing an issue when trying to fetch…

  • updating record with typeORM transactions

    updating record with typeORM transactions

    0 I have quiz api in nestjs, i am using typeORM for saving data, I want to do following transaction: create quiz in quiz table with title and auto generated Id and empty array of questions for each question try to save question in data base with generated quiz_id and questions input save quiz and…

  • TypeORM Entity Association Returns Null for Related Fields in GraphQL Nexus Schema

    TypeORM Entity Association Returns Null for Related Fields in GraphQL Nexus Schema

    0 I’m currently building a GraphQL API using TypeORM and Nexus Schema. I’ve defined several entities with associations between them, such as Product, Brand, and User. The problem I’m facing is that when I query the Product entity using GraphQL, the related fields like category_id and brand_id are returning null values even though there is…