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 Schema at client side?

I am building an android application (native - Java) and want to implement graphql based APIs. My question is that can we share & store the schema of graphql apis at the client side just like we do when using GRPC with protocol buffers. (I have…
0
votes
0 answers

What is the best practice for a GraphQL mutation in an AddToCollection scenario?

Say I have a book-sharing app, and given say a user with a collection of favorite books, when adding a favorite book is the most common best practice that we just use editUser mutation and update their collection of favorites in the user object…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
0
votes
2 answers

How to maintain client-side GraphQL files synched with the one in server-side?

I'm new to GraphQL so please forgive any if this is a silly question. I want to organize GraphQL files(schema and query/mutation files) in client side, which has to be aligned with the GraphQL files on server. What is the good practice for this…
cadenzah
  • 928
  • 3
  • 10
  • 23
0
votes
0 answers

Best Practice for building a GraphQL Schema with

Currently learning GraphQL with Express and Typescript. I am trying to build a Root Schema with Queries and Mutations. I have found a way to do it but I think this isn't the best way to build out a GraphQL schema. Wondering what everyone else has…
Cole Ogrodnick
  • 124
  • 2
  • 9
0
votes
1 answer

Gatsby v5 and GraphQL: 'Error: Schema must contain uniquely named types but contains multiple types named "File".'

I'm developing my website using Gatsby v5 and I'm currently struggling with a GraphQL issue. Problem I use a static GraphQL query to pull the openGraphImageUrl from some GitHub repositories and display each in a card component. In order to have more…
Julian
  • 5,290
  • 1
  • 17
  • 40
0
votes
1 answer

GraphQL Mutation how to make fields optional to update fields only by selection and generate schema

I have a graphql mutation defined as follows type Mutation { updateParts( partId: String! parts: PartRequest! ): UpdatePartsResponse! } input PartRequest { name: String! image: Strings! boltTypes: [Bolts]! } input…
not 0x12
  • 19,360
  • 22
  • 67
  • 133
0
votes
0 answers

How to pass the result of one field to another in graphql

I have a query which gives me the list of projects for which I am using project schema. I want to get the count of repeated users across the projects for which I am calling a function getRepeatedUsersCounter. But I am not sure how do I pass this…
Aditya yadav
  • 119
  • 1
  • 7
0
votes
1 answer

Can't figure out how Sangria does conversion from GraphQL type to Scala type

Context I have setup like so: case class Foo( option_enum_vector_field: Option[Vector[Bar]] // Bar is complicated object which can't be easily expressed with sangria default scalars, but can be created by using Bar.apply(enum_str: String) ) // My…
KugisMugis
  • 143
  • 1
  • 4
0
votes
1 answer

Unable to return an interface or a union type from a field in the schema

I was reading the graphQL doc and I found an issue while working with Inline Fragments and Interfaces They mention in the document that we can also return an interface or union type in the schema, but GraphiQL returns the following error. "Abstract…
Sachin Kumar
  • 3,001
  • 1
  • 22
  • 47
0
votes
0 answers

GraphQL with Mongoose and MongoDB tips on deeply nested objects in arrays

I can't find any answers or tips on how to work with deeply nested data with GraphQL and Mongoose. I would've thought this is a fairly common thing to do, but the docs are also pretty vague when it comes to stuff like this. Here's how my data should…
VeniM
  • 11
  • 2
0
votes
0 answers

Cast or deep copy parent class into subclass for use with OpenAPI and graphql-java

Our apps get their data exclusively from internal graphql endpoints running on Spring Boot servers. These servers integrate with public or private APIs via CXF and/or clients generated by Swagger documents. This allows us to have a standard…
IVR Avenger
  • 15,090
  • 13
  • 46
  • 57
0
votes
0 answers

Extracting GraphQL arguments as GraphQL in AppSync mapping templates

I'm trying to set-up AppSync to forward certain resolvers to a Lambda which already exposes a GraphQL interface. For this I need to construct the query or mutation which the user submitted to AppSync, and submit it to my service. While I'm able to…
Isac Casapu
  • 1,163
  • 13
  • 21
0
votes
0 answers

Should names of field in mongoDB model and graphql schema be the same to work?

In GraphQL should the names of fields in schema(typedef) and the names of fields in mongoDB model match for a getAll query resolver? eg :- product has a field "name" in schema and "title" in model definition. model for product :- const…
0
votes
1 answer

How to create an array in the GraphQL's argumment as GraphQL Code First Approach

In GraphQL Code First Approach I am trying to pass the same argumment for createUser in createManyUser but I want to pass it as an array to create many users at once. I searched a lot but couldn't find it in GraphQL Code First Approach. The…
0
votes
0 answers

Which `apollo-server-express` Version Work Best For These Apollo Server Packages?

I’m trying to get apollo-server-lambda or apollo-server-express to work with an executable schema for v3.36. Here are the packages we use: apollo-server-express@3.36 or…
Franz Noel
  • 1,820
  • 2
  • 23
  • 50