Tag: graphql-js
-
Apollo parse exception in Android
1 Thanks in advance for help me. In my previous code GraphQL code was working but we want to migrate the Aws Amplify when we added the Amplify after words i am getting the data in interceptor but after that getting exception- "com.apollographql.apollo.exception.ApolloParseException: Failed to parse http response" "Parameter specified as non null is null…
-
How to pass specific key from `$data` into the nested graphql query?
0 There are publications and tags with many-to-many relations. Here’s schema.gql: input GetPublicationsDto { cursor: Int take: Int tagIds: [Int!] tagId: Int … } input GetTagsForDto { tagIds: [Int!] tagId: Int } type Query { publications(data: GetPublicationsDto!): [Publication!]! tagsFor(data: GetTagsForDto!): [Tag!]! } We see that GetPublicationsDto extends GetTagsForDto. Suppose we want to get publications by…
-
Remove read-only fields before mutation in GraphQL
10 I’ve got a type called Article in my schema: type Article { id: ID! updated: DateTime headline: String subline: String } For updates to it, there’s a corresponding input type that is used by a updateArticle(id: ID!, article: ArticleInput!) mutation: input ArticleInput { headline: String subline: String } The mutation itself looks like this:…
-
Multi Level Query with GraphQL
0 I have 2 data tables: Project and Reason. Each Project with a unique ID has a bunch of reasons tied to it with their own unique ID. ProjectId is a foreign key to Reason. I want to pull up a single Reason with a given ProjectId and a ReasonId, but ReasonId exists in the…
-
Dynamic generate GraphQL schema supports
11 Is it possible to dynamically create a GraphQL schema ? We store the data in mongoDB and there is a possibility of new fields getting added. We do not want any code change to happen for this newly added field in the mongoDB document. Is there any way we can generate the schema dynamically…
-
Use custom decorator to add extra fields to TypeGraphQL @ObjectType class
0 Is there a way to create a custom class-level decorator that adds two parameters to a TypeGraphQL @ObjectType class? Example: @ObjectType() @Timestampable // custom decorator class User { @Field() email: string; } The @Timestampable decorator should add the createdAt and updatedAt props to the User class and the new props should show up in…
-
Issue with React App Strapi GraphQL Mutation for Creating Comments
0 I’m currently facing an issue with my React app where I’m attempting to create a new entry using GraphQL mutation. When I executed the following code in the Strapi GraphQL playground, it worked successfully, and the entry appeared on the Strapi dashboard: mutation{ createComment( data: { userName: "Jane" content: "fdfddf" post: 3 publishedAt: "2023-08-19T06:32:49.783Z"…
-
Apollo client: mutate is not a function
2 I am calling this component from a parent component that is passing props thru the argument fields. However When I try to call the mutation function I keep getting the error: mutate is not a function. I dont understand what is causing this issue as I followed the apollo documentation online almost exactly. const…
-
GraphQL Expected Iterable, but did not find one for field xxx.yyy
93 I’m currently trying GraphQL with NodeJS and I don’t know, why this error occurs with the following query: { library{ name, user { name email } } } I am not sure if the type of my resolveLibrary is right, because at any example I had a look at they used new GraphQL.GraphQLList(), but…
-
what’s the difference between parseValue and parseLiteral in GraphQLScalarType
91 Looking through the GraphQL documentation for custom scalar types (I’m trying to create my own date type) I’m not sure what the difference between parseValue and parseLiteral are. https://graphql.org/graphql-js/type/#graphqlscalartype The documentation doesn’t seem to include any descriptions of what the functions are supposed to do. Can someone let me know what the requirements are?…