Configure Prisma Data Source

The Prisma data source loads a Prisma schema from a file and generates a GraphQL schema.

Example Configuration

1
2
3
4
5
6
7
8
9
10
11
12
13
// wundergraph.config.ts
const db = introspect.prisma({
apiNamespace: 'wundergraph',
prismaFilePath: './schema.prisma',
introspection: {
disableCache: true,
},
});
configureWunderGraphApplication({
apis: [db],
});

Define the prismaFilePath which is the file path to the schema. To avoid naming conflicts, you should also define an apiNamespace.

Since the Prisma DataSource does not perform any remote operations during instrospection and generates your GraphQL schema very fast, we recommend turning off the cache.

To do so, specify disableCache: true.

Was this article helpful to you?
Provide feedback

Edit this page