Solution for querying data using graphql #4149
Answered
by
0xtomoon
0xmonkeyking
asked this question in
Q&A
-
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.
Answered by
0xtomoon
Jul 21, 2024
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.
0 replies
-
Unfortunately graphql client doesn't support recursive query for now. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
0xmonkeyking
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.