You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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
The text was updated successfully, but these errors were encountered: