Tag: graphql
-
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…
-
Unable to connect to WPGraphQL
0 I am new to building with Gatsby and wordpress. when i run "gatsby develop", i get this error on my command line "Unable to connect to WPGraphQL, Either WPGraphQL is not active or there are some WordPress PHP filters in your site which are adding additional output to the GraphQL response. These may have…
-
How to dynamically define GraphQL query string, given typescript types based on GraphQL schema?
0 I have a Node application where I have generated typescript types from GraphQL schema. My service is going to receive GraphQL Object and attributes details in an API request. The service has to form a GraphQL query string and return in the response. For example, If the request is ‘Object.attribute = value’, then the…
-
how to pass date variable to graphQL call in svelte?
1 I have a graphql file with a date in ISO format. I would like to pass a variable instead of hard-coding the date. I would like to use Date.toISOstring() or some get current date method. GRAPHQL FILE let today = Date.toISOString() //or DateNow() query guide { tv { guide(date: "2022-08-10T00:00:00Z <-replace–${today}") { entries {…
-
Graphql-go Has No Built-In Validation For Argument/Variables Passed On?
1 I am building golang graphql endpoint with graphql-go https://github.com/graphql-go/graphql Here is chunk of my resolver.go func GetRootMutation(db *gorm.DB, req *http.Request) *graphql.Object { rootMutation := graphql.NewObject(graphql.ObjectConfig{ Name: "RootMutation", Fields: graphql.Fields{ "send_otp_email": SendOtpEmail(db, req), }, }) return rootMutation } func SendOtpEmail(db *gorm.DB, req *http.Request) *graphql.Field { return &graphql.Field{ Type: graphqlGlobal.ResultType, Description: "Send OTP to user’s email.",…
-
How to make Rails app with Graphql to take “name” and “repos” from api.github?
-1 A form in which you need to enter GitHub_login, after processing the form, display the github name and the list of repos. Example: Enter: dhh Output: David Heinemeier Hansson actioncable asset-hosting-with-minimum-ss1 bundler The server should process requests using GraphQL (https://github.com/rmosolgo/graphql-ruby). It should pull data from GitHub and process it. To get data from GitHub,…