<commit_before># GraphQL for .NET

[![Join the chat at https://gitter.im/joemcbride/graphql-dotnet](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/joemcbride/graphql-dotnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

This is a work-in-progress implementation of [Facebook's GraphQL](https://github.com/facebook/graphql) in .NET.

This project uses [Antlr4](https://github.com/tunnelvisionlabs/antlr4cs) for the GraphQL grammar definition.

## Installation

You can install the latest version via [NuGet](https://www.nuget.org/packages/GraphQL/).

`PM> Install-Package GraphQL`

## Usage

Define your type system with a top level query object.

```csharp
public class StarWarsSchema : Schema
{
  public StarWarsSchema()
  {
    Query = new StarWarsQuery();<commit_msg>Add GraphiQL screenshot<commit_after># GraphQL for .NET

[![Join the chat at https://gitter.im/joemcbride/graphql-dotnet](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/joemcbride/graphql-dotnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

This is a work-in-progress implementation of [Facebook's GraphQL](https://github.com/facebook/graphql) in .NET.

This project uses [Antlr4](https://github.com/tunnelvisionlabs/antlr4cs) for the GraphQL grammar definition.

## Installation

You can install the latest version via [NuGet](https://www.nuget.org/packages/GraphQL/).

`PM> Install-Package GraphQL`

## GraphiQL
There is a sample web api project hosting the GraphiQL interface.
![](http://i.imgur.com/KUZM5N9.png)

## Usage

Define your type system with a top level query object.

```csharp
public class StarWarsSchema : Schema
{
  public StarWarsSchema()
  {
    Query = new StarWarsQuery();
{'fraction_non_alphanumeric': 0.12849800114220444, 'fraction_numerical': 0.0057110222729868645, 'mean_word_length': 5.234875444839858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '274084', 'n_tokens_mistral': 623, 'n_tokens_neox': 599, 'n_words': 136}