Tag: graphql
-
Mutation Chaining in apollo superGraph
0 I need to insert record in through one SubGraph and based on returned Id I want to update record in another SubGraph. Looks like apollo doesn’t support mutation chaining directly (can’t pass Id from one mutation to the other one). Can we do a query, get an Id and then use that in a…
-
Implementing Middleware to Retrieve JWT Tokens from Header in a GraphQL Server with Node.js and Apollo
0 I’m trying to create a middleware to receive a token from the header, but it never seems to trigger, and I never see the ‘hello’ log message I inserted at the top of the middleware. const jwt = require(‘jsonwebtoken’); const { GraphQLError } = require(‘graphql’); module.exports = async ({ req }) => { console.log(‘hello’);…
-
How can spring-boot application easily get data from external GraphQL service?
1 Background My spring-boot-3 application need to get data from external GraphQL API. There I can/need fetch data by 4 different queries. I want to find some generic GraphQL Client with default GraphQL exceptions handling and default response conversion to objects. Question Is there any simple way to call GraphQL API? Any dependency or client…
-
Circular modules: Expected {} to be a GraphQL type
0 I came across this issue called module cycles when requiring modules. Im working on a small star wars graphql api and ill explain in short where i got the issue : I have two type : filmType and charecterType: film.js: const axios = require("axios"); const { GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLList, } = require("graphql"); const…
-
Handling error in apollo graphql returns invalid doctype even when content type is json
-1 I have tried sending 404 status using json-server and it works with postman as seen below. But when I’m doing it inside apollo sandbox, it’s giving me this invalid doctype. Not sure why json-server is sending out html instead of json content type because I’ve already set it Here is the json-server Here’s my…
-
GraphQL Queries Per App in Django (Graphene)
0 I started moving my REST API endpoints to using GraphQL with Graphene. Seems pretty straightforward so far, but one of the things that I like about the REST API (and I cannot figure out in Graphene) is the structure of "endpoints" for each app. I have a lot of apps in my Django application,…
-
@apollo/client local-only field is not resolved when working with service worker
0 I have problems getting local-only fields via typePolicies to work in my app. My setup is the following: This is one of my queries: export const GET_ALL_DEBT_TOKENS = gql` query GetDebtTokens { getDebtTokens { totalSupplyUSD totalReserve totalReserve24hAgo token { address symbol priceUSD @client priceUSD24hAgo } } } `; And this is the config to…
-
ASP.NET Core and GraphQl problem with JWT Authentication
0 I am building an ASP.NET Core Web API with GraphQl, but I am facing issues with JWT token authentication. When the user is logged in I am returning the token, but when I want to create a query or mutation with token provided I see message The current user is not authorized to access…
-
Is there a more efficient way to call multiple apis using graphql and react
0 I am using GraphQL and react on my client side project but I am not using a state management system like Redux I have organised my api calls into custom hook files like below const [getSomeData, { data: getSomeDataData, loading: getSomeDataLoading, error: getSomeDataError }] = useLazyQuery( GET_SOME_DATA2, { client: dataClient, fetchPolicy: "cache-and-network", nextFetchPolicy: "cache-first",…