Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lewis-wow/gql-ts-op


https://github.com/lewis-wow/gql-ts-op

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# GQL TS OP

```ts
const myQuery = build((args: { my_id: string }) => ({
query: {
tweet: {
__args: {
id: args.my_id,
},
date: true,
body: as('my_body'),
author: as('my_author', {
name: true,
id: false,
}),
},
},
}));
```

```json
{
"query": {
"tweet": {
"__args": { "id": { "__variableName": "my_id" } },
"date": true,
"body": { "__as": "my_body", "value": true },
"author": { "__as": "my_author", "value": { "name": true, "id": false } }
}
}
}
```

```graphql
query ($my_id: ID!) {
tweet(id: $my_id) {
date
my_body: body
my_author: author {
name
}
}
}
```