Skip to content

Instantly share code, notes, and snippets.

@jagdishlove
Last active December 19, 2021 18:27
Show Gist options
  • Save jagdishlove/501ead645b13ca33f25094a992c4e365 to your computer and use it in GitHub Desktop.
Save jagdishlove/501ead645b13ca33f25094a992c4e365 to your computer and use it in GitHub Desktop.
export const GET_FILES = gql`
query GetFiles {
files:files(where:{user_id:{_eq:439}}) {
...File
}
}
${FRAGMENTS}
`
export const GET_FILES = gql`
query GetFiles($userId:Int!) {
files:files(where:{user_id:{_eq:$userId}}) {
...File
}
}
${FRAGMENTS}
`
<Query query={GET_FILES}
// variables={{user_id: 439 }}
variables={{userId:student.id}}
fetchPolicy={'cache-and-network'}>
{({ data, loading, error, refetch }) => {
console.log("new Data",data)
refetchRef.current = refetch;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment