Open ToferC opened 1 year ago
Yes that seems like a feature gap, thanks for reporting that. The first thing that comes to mind: we could generate Display
and FromStr
impls for the generated enum types.
Would be very useful :+1: Any plans to support this?
Nobody is actively spending time on this crate, but I can review PRs and cut releases.
Hi folks. Love the work here and using it in a prototype for workforce analytics. I'm struggling to figure out how to use an Enum in a query and would love any guidance on how to get it running.
The API I'm hitting has this query:
The enum is a simple:
The challenge is that I'm getting the CapabilityLevel from a Webform as text, and I can't convert it into a CapabilityLevel to send to the query:
I've tried to use the Strum package, to create a helper enum and can't find a way to create the query in
graphql_client
. I could go back and change the API to not use enums... but that just seems wrong. I hope I'm just missing something here.Thanks in advance for any help.
The API frontend is here: https://github.com/ToferC/epifront
GraphQL Query: https://github.com/ToferC/epifront/blob/main/queries/capabilities/capability_by_name_and_level.graphql
Function: https://github.com/ToferC/epifront/blob/main/src/graphql/capability.rs
And Handler: https://github.com/ToferC/epifront/blob/main/src/handlers/capability.rs