Questions tagged [apollo-server-koa]

5 questions
1
vote
1 answer

Relationship between mongoose and GraphQL schemas in Apollo server

I have this db_schema in Mongoose: const userSchema = new Schema({ uid: { type: String, required: true, unique: true, }, name: { type: String, required: true, }, dept: { type:…
Osama Mohammed
  • 2,433
  • 13
  • 29
  • 61
1
vote
1 answer

`ctx.cookies` is always undefined in apollo-server-koa

I'm using apollo-server-koa and created a simple Koa app + ApolloServer but when I want to access ctx.cookies in the GraphQL resolvers, it's always undefined. Only request and response are there. const app = new Koa() const server = new…
Marvin
  • 41
  • 4
1
vote
1 answer

Enforcing access permissions - AuthDirective drawback

I followed and used the AuthDirective found at https://www.apollographql.com/docs/apollo-server/schema/creating-directives/#enforcing-access-permissions . Its working well within Queries and Mutations. However, I don't understand the statement "One…
SILENT
  • 3,916
  • 3
  • 38
  • 57
1
vote
1 answer

How to access Koa context (and koa-session) from Apollo resolvers?

Given the following Koa application initialization : const apolloServer = new ApolloServer({ ...processSchema(schemas), ...graphqlConfig, cors: false, // already present with Koa context: ctx => { console.log( "*** 2", ctx.session ); …
Yanick Rochon
  • 51,409
  • 25
  • 133
  • 214
0
votes
0 answers

how to koa-mount multiple koa-static serve()

As a junior developer i'm facing a problem with koa-static. I have two graphiQL playground on /private and /admin. The documentation was koa-static serve() from an index.html file (same doc for…