0 I am trying to serialize data from a GraphQL Apollo request into JSON in order to decode into my swift model. However, when trying to serialize the data with an enum it fails. static func decodeUser(userJson:JSONObject)->UserQL?{ let decoder = JSONDecoder() print(userJson) guard let jsonData = try? JSONSerializationFormat.serialize(value: userJson) else { return nil } return […]
2 Is it possible to query a list of Collection-Types in Strapi? The following example: I have three Collection-Types: Restaurant Stores Events The client application does not know which Collection-Types exist and I want to query them dynamically: Example response { contentTypes: [ { name: "Restaurant" }, { name: "Stores" }, { name: "Events" } […]
0 I want to connect my frontend with backend by apollo server. Schema is generated in backend main folder and i have following settings: app.module: GraphQLModule.forRoot<ApolloDriverConfig>({ driver: ApolloDriver, autoSchemaFile: "schema.gql", sortSchema: true, playground: false, }), main.ts: import { NestFactory } from ‘@nestjs/core’; import { GraphQLSchemaHost } from ‘@nestjs/graphql’; import { AppModule } from ‘./app.module’; import […]
0 I’m working on a GitHub Action triggered on the comment of a certain discussion (say org/repo/discussions/6#discussioncomment-7349183) being created or edited. I’d like the action to reply the comment like "your pipeline is running here" with a link. Then I found that there’s only GraphQL way to add a reply like: mutation { addDiscussionComment(input:{ discussionId: […]
0 This is my codegen config: ‘generated/graphql-sdk.ts’: { config: { rawRequest: true }, plugins: [ "typescript", "typescript-graphql-request", "typescript-operations", { ‘fragment-matcher’: { apolloClientVersion: 3, module: "es2015", useExplicitTyping: false } } ] }, For some reason the generated graphql-sdk doesn’t import GraphQLError causing the typing error, I end up needing to add it in manually. This only […]
0 In NestJS and GraphQL while using Bcrypt I had to use it with promise like below async getUser(email: String, password: String) { let user: User[] | User | null = await this.userModel.find({ email }); user = user.length && user[0]; if (user) { return bcrypt .compare(password, user.password) .then((res: any) => { if (res) { return […]
0 so I had this problem for a while now and its driving me crazy. There was one answer on here however it did not help at all. So I am here to post my code to see if someone would be able to discern my stupidity. Login component: import React, { useState, useCallback, useEffect […]
0 I am using artillery node JS based tool for performance testing with yml based scenario. I have installed all the plugin library I am able to run artillery test But I am not able to see logs for what is wrong in my graph ql request and what is response. I tried to set […]
0 I’m trying to call my API but it keeps giving me 400 Error request with the error of: message: "Unknown argument "bookId" on field "book" of type "Explore"." I’ve just read the documentation of Apollo graphql and tried to fetch my data the way it said with variables and args, and it’s in my […]