Skip to content

Commit

Permalink
fix: undefined MyContext
Browse files Browse the repository at this point in the history
  • Loading branch information
appsparkler committed Jul 11, 2023
1 parent 9d611de commit cf412aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/source/workflow/generate-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ import { readFileSync } from 'fs';
// if the server is executed using `npm run`.
const typeDefs = readFileSync('./schema.graphql', { encoding: 'utf-8' });

interface MyContext {
dataSources: {
books: Book[];
};
}

const server = new ApolloServer<MyContext>({
typeDefs,
resolvers,
Expand Down

0 comments on commit cf412aa

Please sign in to comment.