Tag: graphql
-
Convert a comma separated string of fields to a GraphQL query syntax
-1 I have a requiremenet where I need to parse a user input comma separated string, and generate a graphql query out of it. INPUT: queryPath fieldA.fieldB, fieldA.fieldC, fieldA.fieldD.fieldE, fieldA.fieldD.fieldF, fieldA.fieldD.fieldG OUTPUT: query{ queryPath{ fieldA{ fieldB fieldC fieldD{ fieldE fieldF fieldG } } } } I’m using Java to do this, thanks in advance. EDIT:…
-
How to use AWS Amplify GraphQL search and aggregate queries in React code?
0 In the current AWS Amplify React documentation there are no any examples showing how to use these GraphQL queries in React code. Can someone please post an example here. Authentication method needs be the API_KEY. Thanks. query SearchStudentsByEmail { searchStudents(filter: { name: { eq: "Rene Brandel" } }) { items { id name email…
-
Prisma throws an error “TypeError: cannot read property findmany of undefined”
5 I wanted to make a chat app to practice working with graphql and node, for database I used prisma. I was doing everything like in this tutorial. https://www.howtographql.com/graphql-js/0-introduction/ I just changed variable names. so I have this code const { PrismaClient } = require(‘@prisma/client’) const prisma = new PrismaClient() const resolvers = { Query:…
-
Graphql Codegen adds an extra property for my custom scalars
0 I just recently added the typescript-resolvers plugin to my codegen config, and while it does what I need, it seems to also add my custom scalars to the ResolversTypes. The issue is that it seems to add an extra [‘output’] property to these scalars. For example; I end up getting an error: Property ‘output’…
-
How to make sure my graphql subscription api is working?
0 This is my subscription resolver in golang: func (r *subscriptionResolver) CreateChatWithBot(ctx context.Context, req model.CreateChatWithBotRequest) (<-chan *model.CreateChatWithBotResults, error) { ch := make(chan *model.CreateChatWithBotResults) testString := []string{"This", "part", "is", "under", "construction", "…", " Be", "patient", "please!"} go func() { defer close(ch) for _, v := range testString { select { case <-ctx.Done(): return case ch <-…
-
Error: Gatsby query was left in the compiled code while testing with vitest
0 I am working on a Gatsby website and while testing a component with a graphql query using vitest I keep getting this error : Error: It appears like Gatsby is misconfigured. Gatsby related graphql calls are supposed to only be evaluated at compile time, and then compiled away. Unfortunately, something went wrong and the…
-
Apollo Android Client – Cannot access generated classes on classpath
4 I’ve generated the Apollo classes successfully and can see them in the build directory, however they’re not available on the classpath. Strangely the Enum that is generated is available but the classes themselves aren’t. Running the sample project provided on Apollo’s Github does work but I cant see the difference between the configurations. mcve…
-
Best practices for GraphQL in general
0 What are best practices for designing and implementing GraphQL APIs, considering aspects such as schema design, query optimization, error handling, and security? How certain practices contribute to improved performance, maintainability, and overall efficiency in GraphQL development. For example, how you would structure your schema to handle nested queries efficiently. Also what are security concerns…