Tag: Backend
-
Node.js, Apollo Server v4, GraphQL, Mongoose – Category Tree
1 I am trying to create Category Tree with Node.js, Apollo Server v4, GraphQL, Mongoose technologies. But when I want to get the created Category or Subcategory data, the output is not what I want. Categories appear both in subCategories as a reference and as a normal category. I also added category data with this…
-
Node.js, Apollo Server, GraphQL, Mongoose – Category Tree
0 I am trying to create Category Tree with Node.js, Apollo Server, GraphQL, Mongoose technologies. But when I want to get the created Category or Subcategory data, the output is not what I want. Output; { "data": { "getCategories": { "success": true, "response_code": "categories-successfully-retrieved", "message": "Categories Successfully Retrieved!", "categories": [ { "_id": "655a1b6018951b0985fd7635", "name": "K…
-
Mutation validation ids in input for entities from another service. GraphQL Apollo Federation
0 I need to validate ids from mutation There’s example type Query @extends{ calendars( users: [Int] resources: [Int] workgraph_types: [Int] provide_services: Boolean date_from: String date_to: String paging: PagingInput ): CalendarList! @verifyResource } Need to validate ids for resources. I have resource in another microservice. I need to check that resource exists in another microservice. I…
-
Data is not displayed at front end react with graphql queries at node.js backend
0 import { gql } from ‘@apollo/client’; const GET_CLIENTS = gql` query getClients { clients { id name email phone } } `; export { GET_CLIENTS }; import {gql} from ‘@apollo/client’; const DELETE_CLIENT = gql` mutation deleteClient($id: ID!) { deleteClient(id:$id) { id name email phone } } `; export {DELETE_CLIENT}; import React from ‘react’; import…
-
Best framework / language to create a backend service with user auth, service and GraphQL
0 I’m looking for advice on which backend language & framework to pick to implement user auth and GraphQL w/ custom business logic. I’ve built it in the past using Node.JS and manually setting up auth and SMS w/ Twilio, but I’m wondering whether there’s a faster way to do it these days (this was…
-
Should I use REST or GraphQL for the login?
0 I have a GraphQL API, but I have doubts about whether to login in a graphql mutation or do it in a REST endpoint, I know that it can be done in both ways. Any comments? I have read and even in some courses I heard that for the login the ideal is to…
-
Error: “Query.getAllBooks” was defined in resolvers, but not in schema
0 I’m currently working on a small Nest.js application where I want to create a GraphQL query to retrieve an array of books. However, I’m encountering an issue where I’m not getting the expected response. I’ve provided the relevant code snippets below. Can someone please help me identify what I might be doing wrong? src/books/books.dto.ts…
-
Apollo Server 4 / Koa – Cannot read properties of undefined (reading ‘headers’)
0 i upgraded to apollo 4 and i am using koa js. But there are some problems with context. Authentication process does not work. Authentication time I get an error like this: **"message": "Cannot read properties of undefined (reading ‘headers’)" "code": "INTERNAL_SERVER_ERROR", @[email protected][email protected]/node_modules/@apollo/server/dist/esm/utils/schemaInstrumentation.js:36:28) backend/graphql/resolvers/posts.js:31:20 backend/util/check-auth.js:5:36** import { ApolloServer } from "@apollo/server"; import { ApolloServerPluginDrainHttpServer }…
-
Nest.js + Prisma relationship constantly returning null
0 I’m using Nest.js + GraphQl + Prisma, and trying to create 3 tables: User, Post, and Viewers When getting 1 post I need to add the user as viewer. Successfully saving it to the db but when returning the relationship, viewers is constantly null Here’s my prisma schema: model User { id Int @id…