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
Is your feature request related to a problem? Please describe.
I want to be able to request a field or not request it based on data in runtime.
Imagine scenario, user has a set of settings, and if some of them are turned off there is no need to fetch certain data from GraphQL API, of course one single field may not matter but if there a couple of them it may start to add up, especially if field is complex type.
To visualise consider currently not working snippet of code
usingvarhttp=new HttpClient(){BaseAddress=new Uri("https://swapi-graphql.netlify.app/.netlify/functions/index")};usingvarclient=new ZeroQLClient(http);vargetHomeWorld= Convert.ToBoolean(Random.Shared.Next(0,2));// Imagine this coming from user settings// Line below produces ZQL0002: Failed to convert to graphql query: getHomeWorld ? p. Homeworld(h => h. Name) : default(string)varresult=await client.Query(o => o.Person(id:1, selector:p =>new{ p.Id, p.Name, HomeWorld =getHomeWorld? p.Homeworld(h => h.Name):default(string)}));
Describe the solution you'd like
Any solution would do, support of ternary operator from example above may be one of them.
Describe alternatives you've considered
Requesting all data that may potentially be needed.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to be able to request a field or not request it based on data in runtime.
Imagine scenario, user has a set of settings, and if some of them are turned off there is no need to fetch certain data from GraphQL API, of course one single field may not matter but if there a couple of them it may start to add up, especially if field is complex type.
To visualise consider currently not working snippet of code
Describe the solution you'd like
Any solution would do, support of ternary operator from example above may be one of them.
Describe alternatives you've considered
Requesting all data that may potentially be needed.
The text was updated successfully, but these errors were encountered: