Questions tagged [graphql-schema]

A GraphQL schema is at the center of any GraphQL server implementation and describes the functionality available to the clients which connect to it.

To make it easy to understand the capabilities of a server, GraphQL implements a human-readable schema syntax known as its Schema Definition Language, or "SDL". The SDL is used to express the types available within a schema and how those types relate to each other.

https://www.apollographql.com/docs/apollo-server/schema/schema/#targetText=A%20GraphQL%20schema%20is%20at,schema%20is%20the%20%22type%22.&targetText=Define%20which%20data%2Dfetching%20(querying,be%20executed%20by%20the%20client.

62 questions
1
vote
0 answers

tried to redefine existing error around graphql

I have 2 project(graphql client) with schema.graphqls each fro different graphql endpoints, and have some same definitions. Project A --schema.graphqls --type Order... type Product... Project B --schema.graphqls --type order... type Product... The…
H Nakazawa
  • 11
  • 2
1
vote
0 answers

Dynamically modify GraphQL schema and see updated schema with GraphiQL

I have a GraphQL schema: enum CustomType { Foo Bar } But I need to add enum items from my database. For that, I have made a Visitor that modify the schema model during runtime: @Configuration(proxyBeanMethods = false) class GraphQlConfig { …
Oromis
  • 196
  • 2
  • 13
1
vote
1 answer

How to return ID as a key in AppSync GraphQL schema?

I need to return following object to client: { id: "be49e436-1da0-463e-91fc-e53695cee00b", groupName: "Maintainance Workers", groupId: "c0fc9f0c-af0e-43d8-b896-560dc389b506", groupDescription: "Lorem ipsum Description", …
Zain Ul Abideen
  • 1,617
  • 1
  • 11
  • 25
1
vote
0 answers

graphql @skip @include directives cannot query field

I want to use graphql @include and/or @skip directives for compatibility between frontend and backend. Assume backend and frontend have a differing schema: backend: type Foo { someOldProp: Int! } frontend: type Foo { someOldProp: Int!…
1
vote
2 answers

Route GraphQL requests to APIs in different regions serving different content but using same schema

We deploy backend services with GraphQL API in multiple AWS regions. The GraphQL schema is the same for each region, but the services serve region specific data. Apollo federation does not seem to address this topic, because we do not want to merge…
1
vote
1 answer

AWS-LAMBDA: no such file or directory, open './src/graphql/schema.graphql'

I am practicing Graphql and AWS. I used simple serverless framework also create simple Graphql schema. I deployed the schema(seems like this graphql.schema file does not deploy), resolvers to AWS. It successfully create a DynamoDB table and lambda.…
Krisna
  • 2,854
  • 2
  • 24
  • 66
1
vote
1 answer

Filter data in array using GraphQL variables and Next JS

Trying to filter data using GraphQL variables and Next JS. How can I pass my state to the GraphQL variable "name" ? handleSelectedFilter will update the filter state based on the selected option. I am expecting the value of the filter state to get…
1
vote
1 answer

I need a type for a graphql property that could be two 2 types

So I have some code like the following: input Data { activityValue: Int } But I need it to be something more like input Data { activityValue: Int | String! } I know in typescript, even though frowned upon you can use any or number | string. Is…
Tom Bird
  • 999
  • 3
  • 17
  • 31
1
vote
0 answers

GraphQL NodeJS Error: One of the provided types for building the Schema is missing a name

i am learning GraphQL with NodeJS but getting the error. i have develop a mongoDB and NodeJS GraphQL REST API for Understanding and Learning purpose Here is my Code : const graphql = require('graphql'); const user = require('../models/User'); const…
1
vote
2 answers

Error when building typedefs TypeError: Cannot read property 'some' of undefined

I am getting the following error when building Typedefs in Apollo Server: return typeDef.definitions.some(definition => definition.kind === language_1.Kind.DIRECTIVE_DEFINITION && ^ TypeError: Cannot read property…
chris
  • 2,490
  • 4
  • 32
  • 56
1
vote
1 answer

Get schema with n-deep wrapper type stack

I'm getting data from a database through GraphQL. There are two types: Group and Person. Groups have a field people which is a list of Person objects. I'm trying to get a schema from the server using GraphQL's built-in introspection. The problem…
Sandy Gifford
  • 7,219
  • 3
  • 35
  • 65
1
vote
1 answer

How to use Time type as scalar in a GraphQL SDL?

I have an object "business" and I'm trying to schematize it in GraphQL. Since DateTime and Time are not per default available on Graphql, i come across the following library : github. Business.graphql: type Business { businessId: ID! name:…
3logy
  • 2,634
  • 8
  • 46
  • 99
1
vote
1 answer

Is there a way that we can declare the type from a different gql file?

I've been trying to make this one work. I am currently learning Apollo Server and GraphQL. I went to different documentations but I can't seem to find an answer. Here's what I am trying to do. I have usertypes.js and here's the code snippet: const {…
ashlrem
  • 117
  • 1
  • 3
  • 17
1
vote
1 answer

How to create an alias for a GraphQLString type?

In some languages you can rename a basic type like string to something else: type alias UUID = String It's still a string type, but now you can reason better about the code. Because is not all the strings in the universe.. is just UUID shape of…
AIon
  • 12,521
  • 10
  • 47
  • 73
0
votes
1 answer

Python parse a graphqls file

Is there a lib/tool for Python to automatically parse a graphqls file? If not, what is a good way to parse the file? I have a Python project that is part of a larger Java project that contains a .graphqls file with the enum, input, and type…
Ebad
  • 131
  • 11