Prisma plugin should support async query parameter
- Dominant language
- TypeScript
- Stars
- 2.6k
- Forks
- 184
- Avg merge
- 4h 25m
- Merged PRs (30d)
- 137
Description
Given the following code:
```ts
playlists: t.relatedConnection('uploadLists', {
cursor: 'createdAt_id',
authScopes: privateAuthScopes,
query: async (_args, context) => {
const userId = (await context.session)?.appUserId;
invariant(userId, 'No userId');
return {
where: { type: UploadListType.PLAYLIST, author: { id: userId } },
};
},
}),
```
I get the following error:
It would be great if `query` could be `async` for when query parameters need to use external resources.
Contributor guide
Research direction
Start by locating the Prisma plugin implementation that handles the `query` option shown in the issue and inspect how its return value is processed. Update the behavior so an asynchronous query can resolve to the requested filter object, then verify that the example no longer produces the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100