Tag: graphql
-
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…
-
Should I use REST or GraphQL for the login?
0 I have a GraphQL API, but I have doubts about whether to login in a graphql mutation or do it in a REST endpoint, I know that it can be done in both ways. Any comments? I have read and even in some courses I heard that for the login the ideal is to…
-
Resolve two GraphQL schema fields using one endpoint
2 There’s a situation where there are two possible types to fill data property. I have made a union type for that (ComponentItem) to determine which field needs to be returned. The first schema (ComponentItem1) should just be a hardcoded list but the second one (ComponentItem2) is more dynamic where it gets a searchTerm from…
-
What is the correct way to delete a post within a graphql subscription?
1 I’m working on a project where I have posts that are created and shown on a screen. I’ve done this using graphql subscriptions for real time updating of posts, but I need the user to also be able to delete their own posts and for that update to be shown in real time. The…