Questions

  • Should I use REST or GraphQL for file upload?

    0 I have a GraphQL API, but I have doubts about whether to file upload in a graphql mutation or do it in a REST endpoint, I know that it can be done in both ways. I have read that for file uploading the ideal is to have a REST endpoint instead of a mutation. […]

  • Rails graphql-batch: Dependent fields that use loaders

    0 I have a Rails 7 GraphQL API, and I’m using the graphql-batch custom loaders to handle some n+1 query issues. In my GraphQL type definition, I have two fields, has_upcoming_schedule and has_available_spot. I want to modify the has_available_spot field so that it returns nil unless there are upcoming schedules. Only if the program has […]

  • How to upload file using graphql-client?

    0 How can I make a mutation call from a client and upload a file? I can do it in the editor (screen) But I cannot figure out how to make the same from a client var request = new GraphQLRequest { Query = query, Variables = new { id = "id" }, }; var […]

  • Are graphql codegen types correct

    0 I’m trying to create a simple next app with typescript using Strapi as a headless CMS. I just want to use Strapi and graphql with typescript to show something in the next app. In Strapi I simply have a Color Content type with two colors, red and blue I have graphql set up in […]

  • Extra double quotes are getting added when using jmeter variable to pass value in GraphQL HTTP request ‘Variable’ in Jmeter

    0 I want to send below request in GraphQL HTTP request in Jmeter – {"pageName":"TEST_SCREEN","section":"TEST_SCREEN","action":{"name":"includeObjects","fields":[{"fieldName":"id_","value":"101"},{"fieldName":"id_","value":"102"},{"fieldName":"id_","value":"103"}]}} I am generating the value of "fields" dynamically and it can have any number of entries. So I generated value for fields and stored in a variable beforehand like below- String request = "["; for (int i = 0 ;i<items.length;i++) […]

  • Error: Unable to find GraphQL endpoint. While trying to generate post type object

    0 Im trying to setup a headless WP project using faustjs, WPgraphQL and ACF. Later im planning to also implement Shopify shopfront API. I was setting up the project, installing all the plugins and setting them up. So i have setup my .env.local and i have setup the faust settings in the WP admin panel. […]

  • undefined method `ids’ for [#

    0 def resolve(where: {}, order_by: {‘field’: ‘updated_at’, ‘direction’: ‘desc’}) order_by.symbolize_keys! [context[:current_user]] unless context[:current_user].has_capability?(self.class.name.demodulize) cap_belongs_to = context[:current_user].determine_capability_belongs_to(self.class.name.demodulize) users = if cap_belongs_to[:direct] || context[:current_user].user_type == ‘SuperAdmin’ context[:tenant].users.includes([:groups, :roles]).where(where).order("#{order_by[:field]} #{order_by[:direction]}") elsif cap_belongs_to[:group].present? context[:tenant].groups.where(cap_belongs_to[‘group’]).map(&:users).flatten else [context[:current_user]] end stored_user_contents = (UserContent.select("DISTINCT ON (user_id) user_contents.*")) users.to_a missing_user_content_ids = users.ids – stored_user_contents.pluck(:user_id) missing_user_contents = missing_user_content_ids.map do |user_id| UserContent.new(user_id: user_id, on_fly: true) end […]

  • Generate API documentation using spring boot graphql spqr library

    0 We are using Spring boot grphql sqpr library. We have to generate graphql API documentation which can be viewed in graphiql. For e.g. If i have field like below # comma separated location IDs. (eg: ‘5,12,27’) locationIds: String then this string comma separated location IDs. (eg: ‘5,12,27’) should be visible in graphiql. graphql graphql-spqr […]

  • What is [Symbol(kHeaders)] and how do I parse it as headers

    2 I am having trouble parsing the header retrieved from graphql’s context, what I would like to do is to basically forward the headers from the request into the response My gateway: GraphQLModule.forRootAsync<ApolloGatewayDriverConfig>({ driver: ApolloGatewayDriver, inject: [ConfigService], useFactory: async(configService: ConfigService) => ({ server: { introspection: true, playground: true, cache: ‘bounded’ }, gateway: { buildService: (url) […]

  • Custom hook to log request and errors while using either useQuery or useMutation?

    0 Requirement: Create a custom hook (useLoggedAPI) to call either useQuery or useMutation and add logs for request or errors. This utility function will be reused everywhere where there’s an GQL API call. What I have tried so far: /* eslint-disable @typescript-eslint/no-explicit-any */ import { useQuery, useMutation, AnyVariables, UseQueryArgs, DocumentInput, CombinedError, UseQueryResponse, UseMutationResponse, } from […]