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
0
votes
0 answers

GraphQL: Stop Neo4jGraphQL translate my models during generation

I'm an experienced developer, but rather new to GraphQL. I use this Neo4j-Tutorial as a basis for orientation and am developing in typescript (backend and frontend). Can anyone tell me how to somehow rename the generated Endpoints from…
0
votes
0 answers

GraphQL matrix schema different types

I want to retrieve a matrix from GraphQL server with this structure: [ ['Country', 'Popularity'], ['Germany', 200], ['United States', 300], ['Brazil', 400], ['Canada', 500], ['France', 600], ['RU', 700] ] My actual schema is like this type…
J.F.
  • 13,927
  • 9
  • 27
  • 65
0
votes
1 answer

With GraphQLSchema, is there syntax to modularlize GraphQLObjectTypes?

How do I refactor userThat (and likely several other related fields) into other nice modular files and then include them into root_query_type.js This is a vanilla node/express/graphql GraphQLObjectType implementation. Or am I destined to have a huge…
0
votes
1 answer

Amplify Mutation connection between two type @model

I am trying to pass a product object to an invoice table so in my case I guess it is a one-to-many where one invoice has multiple products. I tried to do something like this: the schema: type Product @model @key(name: "productIDIndex", fields:…
0
votes
2 answers

Federated GraphQL schema validation

I have created 3 microservices in my project and implemented GraphQL Netflix DGS federation framework. https://netflix.github.io/dgs/ As a company, We are having more than 30 schemas from different micro services from different teams. But, if schema…
Stella
  • 1,728
  • 5
  • 41
  • 95
0
votes
1 answer

How to use different scalar types for one field in graphQL schema?

I have an input type that says: input testInput { a: String b: String c: Boolean } I have a situation where field c can be either String or Boolean. How can i implement the field c that will accept both String and Boolean ?
0
votes
1 answer

How to get GraphQL request context using generated schema

I needed to grab the authentication header and pass it along on my fetch. I found a few different ways to do it but wanted access to the context so I can grab it. All the documentation I saw wasn't related to the typescript way of generating the…
Vince
  • 757
  • 1
  • 8
  • 16
0
votes
1 answer

Disable GraphQL Introspection in graphql-java-tools

I am trying to disable GraphQL Introspection in my project and not having much luck with specific framework I am using. Some articles say it can be done in CcodeRegistry module but that is a decompiled source which is read only. Has anyone achieved…
0
votes
2 answers

Graphql schema design problem that I can't solve

I am trying to design a schema for an application and I have a problem that I can't solve. Here is a detail of the application User A LIKES User B User B MATCHS User B Now User A and User B can start chatting with each others. I also keep track of…
Aimn Blbol
  • 907
  • 11
  • 20
0
votes
1 answer

GraphQL schema - is it possible to set constraints on a custom type field

Here is a simplified snippet out of a GraphQL Schema I work with. There are - an enum, type Contributor and type Review. enum CONTRIBUTOR_TYPE { AUTHOR EDITOR } type Contributor { name: String role: CONTRIBUTOR_TYPE } type Article { …
Lula-Leus
  • 21
  • 3
0
votes
0 answers

GraphQL Schema Language Handle Map Type from Uncontrolled API

Assume we're consuming an API that we don't control. That API returns an array of mapped currency / price pairs like this: [{"GBP":1.092},{"USD":0.878977}] How can this be modelled in a GraphQL schema? Note: the format in which this data arrives on…
Chris Sargent
  • 321
  • 2
  • 13
0
votes
2 answers

GraphQL register new Type wiring with argument to data fetcher

Having a GraphQL schema: type TypeA { id: ID, name: String, other: TypeC } type TypeB { id: ID, name: String, other: TypeC } How should I implement TypeC wiring independently from source object type? I know I can…
Kamila
  • 371
  • 5
  • 13
0
votes
1 answer

Graphql schema design best practice

I have a question below: Let's say I have a product type like this type Option { id: Int! value: String! } type Product{ id: Int! name: String! price: Float! options: Option } If I have a schema like that, every time I need product…
NHT
  • 21
  • 4
0
votes
1 answer

Split union declaration in GraphQL schema over multiple lines

I have a GraphQL-schema that has a union declaration that already has a lot of types, e.g.: union SectionUnion = SectionForm | Section2 | Section3 | Section4 | Section5 I know that lots more sections are coming (not added yet) and at some point the…
drupov
  • 23
  • 6
0
votes
1 answer

creating graphql schema for a response from an API that has an array of objects

I am getting a response from an Api that looks like this: property: Array(100) 0: {identifier: {…}, address: {…}, location: {…}, vintage: {…}} 1: {identifier: {…}, address: {…}, location: {…}, vintage: {…}} 2: {identifier: {…}, address: {…},…