'How to pass dynamic query name to GraphQL?
Is it possible pass query name to GraphQL using props in React?
const allEntries = gql`
query allProducts{
'${queryName}' {
id
name
price
publishedAt
slug
stage
updatedAt
}
}
`;
Solution 1:[1]
Looks like you want something similar to:
query allProducts (where: {id: ${id} }) {
...
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | John Detlefs |