Questions tagged [graphql-tools]

A set of utilities to build your JavaScript GraphQL schema in a concise and powerful way.

GraphQL Tools is an npm package and an opinionated structure for how to build a GraphQL schema and resolvers in JavaScript, following the GraphQL-first development workflow.

Documentation

Repository

115 questions
1
vote
1 answer

a missing sub document turns into a subdocument with undefined values, and schema validation fails

I have a schema.graphqls that looks like this: type House { id: ID! rooms: Int! address: String! owner: Owner } type Owner: { name: String!, age: Int! } and a complementing mongoose schema: export default class House { static…
Nimrod
  • 392
  • 2
  • 9
1
vote
1 answer

graphql mergeSchemas from GraphQLObjectType schemas

I'm new to graphql so i'm facing some problems. Server based on nodeJS with express package. I'm writing my schemas for Apollo Graphql in GraphQLObjectType notation. When i want to merge two schemas in one i use mergeSchemas method from…
1
vote
1 answer

How to include fields in api server and remove it before returning to results to client in Graphql

I have a Node.js GraphQL server. From the client, I am trying get all the user entries using a query like this: { user { name entries { title body } } } In the Node.js GraphQL server, however…
Kalpana
  • 198
  • 5
1
vote
2 answers

How to solve naming conflict in GraphQL?

import { makeExecutableSchema } from 'graphql-tools'; const fish = { length:50 }, rope = { length:100 }; const typeDefs = ` type Query { rope: Rope! fish: Fish! } type Mutation { increase_fish_length:…
left click
  • 894
  • 10
  • 21
1
vote
1 answer

Schema Stitching two remote Prisma/GraphQL schemas

I'm attempting to create a microservice based application that uses two remote Prisma/GraphQL schemas that run in Docker and a gateway that introspects them using schema stitching. Prisma/GraphQL Schemas: // Profile Schema service -…
remedy
  • 125
  • 1
  • 9
1
vote
0 answers

How to log success requests in GraphQL?

I'm using makeExecutableSchema from graphql-tools and I'm using the logger parameter to log errors. However, the logger is never called in success requests. Is there a way to log success requests?
1
vote
1 answer

What is the difference between makeExecutableSchema & buildClientSchema in Apollo GraphQL

I'm trying to build a mocking infrastructure for our react client. Getting confused between the two.
Ananth
  • 837
  • 1
  • 10
  • 20
1
vote
0 answers

Is there a easy way to move a field on a remote graphql schema?

I am trying to integrate with a remote schema using graphql-tools for node. I have the remote schema but unfortunately all of the queries are defined on the Viewer type rather than the Query type. I would like to use graphql-tools to transform the…
1
vote
0 answers

implementing directives in a graphql server

How can I implement a schema that supports something like this: http://graphql.org/learn/queries/#directives When I use $ before a parameter, I get a parsing error GraphQLError: Syntax Error: Expected Name, found…
0
votes
0 answers

How to bundle a graphql project that uses fileloaders? for example graphql-tools

I am trying to bundle my graphql server using esbuild. The problem Im having is when everything is bundled together graphql-tools cant find resolvers and typeDefs due to the file running in a diffrent directory meaning a diffrent __dirname. My…
0
votes
0 answers

How to call sub-field in delegateToSchema

Schema looks like this: type Query { userManagement: UserManagementQueries! } type UserManagementQueries { users(...): UserManagementUsersConnection } ... So the query looks like: query { userManagement { users(ids: [123, 456]) …
Matthias
  • 1,267
  • 1
  • 15
  • 27
0
votes
0 answers

Getting syntax error when running makeExecutableSchema by graphql-tools?

I'm learning how to create graphql servers and i'm trying to create an executable schema with graphql-tools. However, when I run the example code on my server file, it returns a syntax error. Do you know what could be happening? I'm running on…
0
votes
0 answers

How to do schema-stitching and introspection in new @apollo/server and graphql-tools?

I'm working on a Node.js project having a main-service(A central component where various remote microservices which are exposed with respective "port/graphql" are stitched together to create a unified API endpoint. It acts as a gateway or…
0
votes
1 answer

Unable To Print a Custom Directive in a Generated Schema

I am trying to add a directive at run time which is being generated correctly in the output schema, however I require the directive to be used on certain fields and it's not showing up. Here is how I created the directive const limitDirective = new…
0
votes
0 answers

Why input type id is number, but after graphql it`s returning as an object

so i have model/type user: prisma: model User { id Int @id @default(autoincrement()) email String @unique nickname String password String } graphql typedefs: type User { id: Int! email: String! nickname: String! …
dsadad
  • 5
  • 2