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
8
votes
1 answer

Making Graphql input where input can take different types

I want to create mutation apis where input can be of different types, something like interface which we have in types. I know that we cannot have interface in input types, I want to know how we can support multiple input types in just one input. To…
Deepak Patankar
  • 3,076
  • 3
  • 16
  • 35
6
votes
3 answers

Trouble migrating from graphql-import to just graphql-tools with ApolloServer, directives cease to work

My plight began as a simple desire to expand my graphql schema from a single .graphql file to multiple files so i can better organize the schema and so it wouldn;t grow to one huge file out of control. My original layout was very straight forward…
xunux
  • 1,531
  • 5
  • 20
  • 33
4
votes
1 answer

zsh: command not found: get-graphql-schema

I'm trying to download my graphcms schema into my flutter project. I'm using Ferry as the graphql client. According to the ferry docs I just need to run npm install -g get-graphql-schema and then run get-graphql-schema [ENDPOINT_URL] >…
Jason Lloyd
  • 378
  • 7
  • 23
4
votes
1 answer

GraphQLObjectType for subscriptions

I implemented a GraphQL server using Express, and I have an issue with the setup of GraphQL Subscription type. I'm developing a real time chat app and I'm trying to publish an event after a new message is created, but I don't understand how should I…
4
votes
1 answer

Graphql-ruby how to define a hash as type

Is there a possibility to define a Hash as Type field in graphql-ruby schema? In my data structure there is a multi language String type, which consist out of the language code as key and a corresponding text. At the Moment there are 2 languages…
4
votes
1 answer

GraphQL - Union Types giving the error no class could be found for that type name

In my GraphQL schema file I'm trying to add a union type like so: type CoOverrides { coId: String type: String } type SoOverrides { soId: String freeInterval: String } union CoOrSoOverrides = CoOverrides | SoOverrides I then…
userMod2
  • 8,312
  • 13
  • 63
  • 115
3
votes
1 answer

AWS Amplify (AppSync + Cognito) Authorization using dynamic groups per organitzation/tenant

I have an AWS Amplify application that has a structure with multi-organizations: Organization A -> Content of Organization A Organization B -> Content of Organization B Let's say we have the user Alice, Alice belongs to both organizations, however,…
3
votes
2 answers

One to Many Relationship not showing in the object Amplify Schema definition

I am new to using amplify with GraphQL. I was setting up my DB schema and auto-generating the functions after running amplify push. Goals I want to achieve but do not know how to are I would like to be able to get user with all connected…
3
votes
1 answer

How to assign a JSONObject value to a field in graphql schema file?

I am working on an application with graphQL and spring boot framework. Here I am using GraphQL's Schema-first approach to write my schema details. In my scenario, I need to assign JSONObject and JSONArray as input to few of the fields in my Schema…
swanthri
  • 79
  • 1
  • 7
3
votes
1 answer

How can one get a complete GraphQL schema from an Apollo Server endpoint?

I'm writing a GraphQL interface between GraphQL and REST services using Apollo Server. This interface will provide a single GraphQL endpoint for an Apollo Client front. The single service at the moment is a KeystoneJS app which provides a GraphQL…
Cerulean
  • 5,543
  • 9
  • 59
  • 111
2
votes
0 answers

GraphQL extract possible queries from a schema

I have a graphql schema that i'm parsing type User { id: ID! name: String! email: String! age: Int posts: [Post!]! } type Post { id: ID! title: String! body: String! author: User! comments: [Comment!]! } type Comment { id:…
akashmohan
  • 343
  • 3
  • 10
2
votes
1 answer

Filter schema-less json object in GraphQL

I have a data JSON object which has several dynamic fields, because of which I cannot define the schema in Graphql instead I defined it as Json using scalar. My requirement is to filter the fields with the data json object. One sample use case is…
Alex Man
  • 4,746
  • 17
  • 93
  • 178
2
votes
1 answer

Graphql type with id property that can have different values for same id

I was wondering if an object type that has an id property has to have the same content given the same id. At the moment the same id can have different content. The following query: const query = gql` query products( $priceSelector:…
HMR
  • 37,593
  • 24
  • 91
  • 160
2
votes
1 answer

Are fields with list types forbidden in GraphQL schema stitching selection sets?

I have an array of entities that look like this: const aEntities = [ { id: 1, name: 'Test', oneToManyRelation: [ { id: 2 }, { id: 3 } …
1
vote
0 answers

How to query nested field of object Y nested inside paginated objects X regarding the X objects?

I want to have a GraphQL schema like the following: scalar Timestamp input StatsArgs{ start: Timestamp! end: Timestamp } input PaginationArgs{ page: Int! limit: Int! } type Station{ id: ID! name: String! revenue( …
empjon
  • 21
  • 2
1
2 3 4 5