Would you like to use LINQ syntax for your GraphQL queries? In this week's episode, I talk about GraphQLinq, a LINQ to GraphQL API to compose strongly typed GraphQL queries with LINQ query syntax!
Consuming a GraphQL api in C# is straightforward with either using HttpClient directly or using a client library such as GraphQL.Client but both suffer from the same problems: The GraphQL queries do not go through any compile-time checking, and any mistake in the query isn’t discovered until you execute the query at runtime. For example, to query SpaceX GraphQL API for all missions where the manufacturer is Orbital ATK you need to run the following query:
Introduction In part two of this series we built an expression evaluator capable of parsing expressions with parentheses. In this part we are going to add support for expression with variables.
Introduction In previous post I showed how to build a simple expression evaluator using expression trees. Although it works fine it has some drawbacks:
It does not support parentheses. It does not support variables. In some cases the result can be wrong as the parser is not using left to right parsing. It is compiling delegates for every expression which results in slower execution. To solve these issues we will use a different algorithm and deal with all points except variable support.
Introduction This is first part of a series about writing expression evaluator in C#. Even though there are several of them available already I decided to write my own as this one is based on expression trees and is very simple. The evaluator supports numeric expressions as well as expression with parameters.