I have 2 data tables: Project and Reason. Each Project with a unique ID has a bunch of reasons tied to it with their own unique ID. ProjectId is a foreign key to Reason. I want to pull up a single Reason with a given ProjectId and a ReasonId, but ReasonId exists in the Reason table. How can I write a query that will take in ProjectId and ReasonId and query the Reason table and return the single result? I have the following and cannot figure how to get the ReasonId:
export const SINGLE_REASON_QUERY = gql`
query Reasons($projectId: ID!) {
reasons(projectId: $projectId) {
id
text
date
priority