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
I'm building a website that exposes a graphQL api but I would also like to use the graphQL api server-side. I assumed graphql-client would work with juniper since they are related projects but I can't seem to work out how to wire them up.
// I was hoping to do something like this#[derive(GraphQLQuery)]#[graphql(schema_path = "schema.graphql", query_path = "hello_query.graphql")]structHelloQuery;let(res, _errors) = juniper::execute("query { hello }",None,&schema,&juniper::Variables::new(),&ctx,).unwrap();let hello: hello_query::ResponseData = res
// This is the best I have so far converting to json and back again#[derive(GraphQLQuery)]#[graphql(schema_path = "schema.graphql", query_path = "hello_query.graphql")]structHelloQuery;let(res, _errors) = juniper::execute("query { hello }",None,&schema,&juniper::Variables::new(),&ctx,).unwrap();let hello: hello_query::ResponseData =
serde_json::from_str(&serde_json::to_string(&res).unwrap()).unwrap();
Also, the Juniper Value does not work with serde_json::from_value(res)
The text was updated successfully, but these errors were encountered:
DaleLJefferson
changed the title
Is it possible to get Juniper and graphql-client working together
Is it possible to get Juniper and graphql-client working together?
Mar 3, 2020
When #324 it lands should be easier in 2 passes. I'm not sure we can do it at compile time...juniper needs to build and know the schema before the client can be generated.
I'm building a website that exposes a graphQL api but I would also like to use the graphQL api server-side. I assumed graphql-client would work with juniper since they are related projects but I can't seem to work out how to wire them up.
Also, the Juniper Value does not work with
serde_json::from_value(res)
The text was updated successfully, but these errors were encountered: