Questions

  • How to update apollo cache

    0 I am wondering why it’s very hard to update a data inside of apollo client cache, comparing to similar libraries like react-query it’s too complicated For example, When I have a query with pagination (offset and limit) and get an array of items, When I perform a mutation on one item , and from […]

  • In graphql what is difference between a `type query` and `extend type query`?

    0 In graphql what is difference between a type query and extend type query? Ex: difference between type Query { product(id: String!): Product } and extend type Query { DeviceDetail(devId: String!): DeviceDetail } Will appreciate if you could add an example for your explanation. graphql graphql-java spring-graphql netflix-dgs Share Improve this question Follow asked 1 […]

  • Best way to performantly resolve nested GraphQL queries with MongoDB

    0 I am trying to write a resolver which gets the accounts belonging to a customer. The parent.accounts attribute is an array of account_ids. In the code below, I attempt to get an array of accounts for each customer. import Account from "../models/accounts.js"; import Customer from "../models/customers.js"; import { AccountInterface } from "../types/accounts.js"; import { […]

  • loading queries from .graphql files and use them with apollo client and react

    0 Hi guys basicalle I’m creating an app using react, graphql and apollo client, currently I,m loading the queries from a .tsx file with this kind of structure const MULTIPLE_WELLS_FROM_TAO2 = gql` query { query_multiple_wells_from_tao2db { selected_well { opru_fld_nme { value } prod_govt_lse_nbr { value } well_cmpl_seq_nbr { value } } } } `; and […]

  • What is the correct graphql response if a requested child object does not exist?

    0 What shall the graphql server return if a child object does not exist? Example schema: type Person { name: String! address: Address } type Address { street: String city: String } On the server, there is a Person, but no Address exist on that person. The fact that the address is missing is not […]

  • GraphQL Client with spring boot

    0 I have a spring boot GraphQL API and I want to consume it in another spring boot app using GraphQL Client. I am using spring boot version 3. when I execute mutate which works as data is added to the database, I am not able to figure out how to convert the received response […]

  • Best way to resolve nested GraphQL queries with MongoDB

    0 I am trying to write a resolver which gets the accounts belonging to a customer. The parent.accounts attribute is an array of account_ids. In the code below, I attempt to get an array of accounts for each customer. import Account from "../models/accounts.js"; import Customer from "../models/customers.js"; import { AccountInterface } from "../types/accounts.js"; import { […]

  • Why does @graphql-codegen/typescript declare the resolver parent type to be an output type?

    0 I am using @graphql-codegen/typescript to generate types for this graphql schema: type Book { title: String author: String comment: String } type Query { books: [Book] } Excerpt from the generated code: export type Book = { __typename?: ‘Book’; author?: Maybe<Scalars[‘String’][‘output’]>; comment?: Maybe<Scalars[‘String’][‘output’]>; title?: Maybe<Scalars[‘String’][‘output’]>; }; The TS type "Book" is the type used […]

  • GraphQL Swapi api – getting error when fetching

    1 Im kinda new to graphql but i tried my luck with this mini graphql api , but before getting into the point of this question i have some questions before: When using swapi api for example and more specific i want to fetch films , when i write the filmType GraphQLObjectType do i have […]