Tag: apollo
-
How to load a .graphql file using `apollo-server`?
35 I am currently loading the GraphQL schema using a separate .graphql file, but it is encapsulated within strings: schema.graphql const schema = ` type CourseType { _id: String! name: String! } type Query { courseType(_id: String): CourseType courseTypes: [CourseType]! } ` module.exports = schema Then using it for the apollo-server: index.js const { ApolloServer,…
-
GraphQL Client for C++ and .NET
7 Is there an GraphQL client library available for C++ (Windows and Linux) and .NET? From Apollo website I can only see clients for React, Vue.js, Angular, Android, iOS, Ember and Meteor. If there is an Apollo client for C++ and .NET, where is it located ? If not, what should be used ? graphql…
-
How Can I Pass the Auth Middleware to the Apollo GraphQL Server
1 My App.js const mongoose = require(‘mongoose’); const dotenv = require(‘dotenv’); const { ApolloServer } = require(‘apollo-server’); const { startStandaloneServer } = require(‘@apollo/server/standalone’); const typeDefs = require(‘./apolloGraphql/schema’); const resolvers = require(‘./apolloGraphql/resolvers’); const auth = require(‘./Middleware/Auth’); dotenv.config({ path: ‘./config/.env’ }); const server = new ApolloServer({ typeDefs, resolvers, }); mongoose .connect(process.env.MONGOURI) .then((result) => { return server.listen(process.env.PORT, (req,…
-
Authenticate Apollo Client to AWS AppSync with Cognito User Pools
5 I am trying to connect to my AWS AppSync API using the plain Apollo Client but I am not sure how to structure the authentication header correctly. So far I have followed the header authentication documentation here: https://www.apollographql.com/docs/react/recipes/authentication.html And have this code, which I adapted to include the token call to the Amplify authentication…
-
How to check to which service is being queried by Apollo Gateway
0 I have two services in my Apollo Gateway configuration. I can only connect to one of them with a VPN. I would like to check this using the X-Forwarded-For header. public makeGateway = (): ApolloGateway => { const gateway = new ApolloGateway({ debug: this.config.DEBUG, supergraphSdl: new IntrospectAndCompose({ subgraphs: this.config.services, }), buildService: this.buildService, serviceHealthCheck: true,…