All Projects → telia-oss → graphql-typed-client

telia-oss / graphql-typed-client

Licence: MIT, MIT licenses found Licenses found MIT LICENSE MIT LICENSE.txt
Strongly typed GraphQL client for .NET

Programming Languages

C#
18002 projects
powershell
5483 projects

Projects that are alternatives of or similar to graphql-typed-client

character-overlay
Web App for adding an OBS overlay with character information such as name, picture, and health for your favorite role-playing game.
Stars: ✭ 17 (+6.25%)
Mutual labels:  graphql-client
python-graphql-client
Simple module for making requests to a graphQL server in python.
Stars: ✭ 65 (+306.25%)
Mutual labels:  graphql-client
LiveGQL
Use GraphQL Subscriptions on iOS 👌
Stars: ✭ 84 (+425%)
Mutual labels:  graphql-client
swift-di-explorations
Functional DI explorations in Swift
Stars: ✭ 28 (+75%)
Mutual labels:  typesafe
ts-types-utils
Type utilities for typescript
Stars: ✭ 55 (+243.75%)
Mutual labels:  typesafe
typesafe-react-router
Utility functions to help facilitate type-safe routing with react-router
Stars: ✭ 90 (+462.5%)
Mutual labels:  typesafe
SwiftyPods
Type safe pods
Stars: ✭ 15 (-6.25%)
Mutual labels:  typesafe
py-graphql-client
Dead-simple GraphQL client with subscriptions over websockets
Stars: ✭ 36 (+125%)
Mutual labels:  graphql-client
freecli
Command line parsing library using Free Applicative
Stars: ✭ 29 (+81.25%)
Mutual labels:  typesafe
wai-routes
Typesafe URLs for Haskell Wai applications
Stars: ✭ 41 (+156.25%)
Mutual labels:  typesafe
protoc-gen-twirpql
Generate A GraphQL Layer from A Twirp Server: https://twirpql.dev
Stars: ✭ 49 (+206.25%)
Mutual labels:  graphql-client
nim-graphql
Nim implementation of GraphQL with sugar and steroids
Stars: ✭ 47 (+193.75%)
Mutual labels:  graphql-client
type-guards
Simple utility for runtime type checking which also assigns the correct type if used with TypeScript.
Stars: ✭ 30 (+87.5%)
Mutual labels:  typesafe
showcase
A Full Stack Journey with Micro Services and Micro Front Ends. Using dapr, kubernetes, react module federation and web assembly,
Stars: ✭ 45 (+181.25%)
Mutual labels:  graphql-client
neo4j-graphql-java
Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher
Stars: ✭ 94 (+487.5%)
Mutual labels:  graphql-client
HtmlFlow
HtmlFlow Java DSL to write typesafe HTML
Stars: ✭ 119 (+643.75%)
Mutual labels:  typesafe
kobby
Kobby is a codegen plugin of Kotlin DSL Client by GraphQL schema. The generated DSL supports execution of complex GraphQL queries, mutation and subscriptions in Kotlin with syntax similar to native GraphQL syntax.
Stars: ✭ 52 (+225%)
Mutual labels:  graphql-client
elm-graphql
GraphQL made easy in Elm!
Stars: ✭ 56 (+250%)
Mutual labels:  graphql-client
vastringify
Type-safe Printf in C
Stars: ✭ 60 (+275%)
Mutual labels:  typesafe
aws-mobile-appsync-sdk-android
Android SDK for AWS AppSync.
Stars: ✭ 101 (+531.25%)
Mutual labels:  graphql-client

Strongly typed client for GraphQL in .NET

NuGet Badge Build status

This project is currently work in progress and contains only very basic functionality. Usage in production is discouraged unless you know what you're doing.

A typesafe way how to request data from GraphQL API.

First, you generate a model

You can get this Visual Studio extension which automatically generates a cs file out of graphql schema file.

For example this IDL

type Query {
	a: Int
	b(x: Int!): Int!
}

will be translated into

namespace Schema
{
    using System;
    using System.Collections.Generic;
    using Telia.GraphQL.Client.Attributes;

    public class Query
    {
        [GraphQLField("a")]
        public Int32? A
        {
            get;
            set;
        }

        [GraphQLField("b")]
        public Int32 B(Int32 x)
        {
            throw new InvalidOperationException();
        }
    }
}

Create a client based on your schema

This part will be eventually automated with schema generation

public class MyClient : GraphQLCLient<Query>
{
    public Client(string endpoint) : base(endpoint)
    {
    }
}

Then request your data using the generated model

Create requests towards your GraphQL API while keeping full intellisense over the schema.

For example:

var client = new MyClient("<your_endpoint>");

var data = client.Query(e => new
{
    a = e.A,
    b = e.B(12)
});

Console.Write(data.a);
Console.Write(data.b);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].