Tips on using with a GraphQL endpoint? #38
Unanswered
andybywire
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Did you figure anything out here? I ran into the same issue and would love some guidance - digging a little it looks like the plugin is looking for an Array but gets an object? I haven't been able to get any other plugins to work either. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thank you for this plugin!—this is a great tool for content-first/content-driven design.
I have a question about using data from and API (“data from clipboard link”). I’m pulling in data from a headless CMS (Sanity), and whether I use Sanity’s standard HTTP API endpoint, or the GraphQL API, the data always comes back as nested in a “data” or “result” object, which puts the properly formatted array of objects JSON-to-Figma needs one (or two) object(s) too far away:
Here’s a simple query from each of these endpoints to show you what I mean:
https://4g5tw1k0.api.sanity.io/v2021-03-25/data/query/production?query=*[_type==$type]{title,metaDescription}&$type="method”
https://4g5tw1k0.api.sanity.io/v1/graphql/production/default?query={allMethod{title,metaDescription}}
I have not ruled out user error on my part in getting this to work, so here are two questions:
I’d be happy to add a “show and tell” example or make some suggestions for the docs if there’s a solution for this that I just wasn’t able to get the first time around. Thanks again for all the great stuff this tool already does!
Beta Was this translation helpful? Give feedback.
All reactions