Solution for querying data using graphql #4149
-
I need to fetch data for file directory with this format.
How can I query data from using graphql client? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There'a a lot of facets to your question, without the neccesary information it will be hard to get to the correct answer.
An example query for this schema would be query getDirectory($dir: ID!) {
directory(id: $id) { id name }
} In a fetch call this would look like fetch('your-url', {
method: 'POST',
body: JSON.stringify({ query, variables: { dir: 'x' } })
}) you can read more here |
Beta Was this translation helpful? Give feedback.
-
Unfortunately graphql client doesn't support recursive query for now. |
Beta Was this translation helpful? Give feedback.
Unfortunately graphql client doesn't support recursive query for now.
Instead you can query the file directories in raw string and parse them in response.