Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adelarsq/suave_graphql_sample
Suave GraphQL Sample
https://github.com/adelarsq/suave_graphql_sample
dotnet fsharp graphql
Last synced: 1 day ago
JSON representation
Suave GraphQL Sample
- Host: GitHub
- URL: https://github.com/adelarsq/suave_graphql_sample
- Owner: adelarsq
- Created: 2020-09-20T00:58:10.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-15T17:35:11.000Z (about 2 years ago)
- Last Synced: 2024-11-10T08:35:45.140Z (8 days ago)
- Topics: dotnet, fsharp, graphql
- Language: F#
- Homepage:
- Size: 2.93 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-fsharp-project-templates - adelarsq/suave_graphql_sample - Suave GraphQL Sample (Server Side / Suave)
README
# Suave GraphQL Sample using .NET 5
[Suave](https://suave.io) is a full async stand alone web server developed in [F#](https://fsharp.org).
[GraphQL](https://graphql.org) is an open-source data query and manipulation language for APIs.
This project is a sample showing how to use GraphQL on Suave using [.NET 5](https://devblogs.microsoft.com/dotnet/introducing-net-5).
## How to use?
On the terminal run with:
```
cd src/App
dotnet run
```The server will start on the address `http://127.0.0.1:8080`.
## Queries
With a GraphQL client you can test with the follow queries:
```graphql
query {
viewer {
id
name
age
}
}
```Query with fragments:
```graphql
fragment userFragment on User {
widgets(first: 10) {
edges {
node {
id
name
}
}
}
}
query {
viewer {
...userFragment
}
}
```## Acknowledgments
This project is based on the [FSharp.Data.GraphQL](https://github.com/fsprojects/FSharp.Data.GraphQL) samples.