Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tarantool/luagraphqlparser
GraphQL parser based on libgraphqlparser for Lua
https://github.com/tarantool/luagraphqlparser
graphql graphql-lua lua
Last synced: 4 days ago
JSON representation
GraphQL parser based on libgraphqlparser for Lua
- Host: GitHub
- URL: https://github.com/tarantool/luagraphqlparser
- Owner: tarantool
- Created: 2020-12-15T10:58:32.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-03T11:39:25.000Z (about 3 years ago)
- Last Synced: 2023-03-11T01:33:43.730Z (over 1 year ago)
- Topics: graphql, graphql-lua, lua
- Language: C++
- Homepage:
- Size: 99.6 KB
- Stars: 5
- Watchers: 19
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Luagraphqlparser
Lua-binding of [libgraphqlparser](https://github.com/graphql/libgraphqlparser)
compatible with [graphql-lua](https://github.com/bjornbytes/graphql-lua).Differences from graphql-lua parser:
* Improved error messages
* Null support
Usage:
```lua
parse = require('luagraphqlparser').parse
parse([[
query HeroComparison($first: Int = 3) {
leftComparison: hero(episode: EMPIRE) {
...comparisonFields
}
rightComparison: hero(episode: JEDI) {
...comparisonFields
}
}
fragment comparisonFields on Character {
name
friendsConnection(first: $first) {
totalCount
edges {
node {
name
}
}
}
}
]])
---
- definitions:
- operation: query
kind: operation
variableDefinitions:
- type:
name:
kind: name
value: Int
kind: namedType
kind: variableDefinition
variable:
name:
kind: name
value: first
kind: variable
defaultValue:
kind: int
value: '3'
name:
kind: name
value: HeroComparison
selectionSet:
selections:
- selectionSet:
selections:
- name:
kind: name
value: comparisonFields
kind: fragmentSpread
kind: selectionSet
kind: field
alias:
name:
kind: name
value: leftComparison
kind: alias
name:
kind: name
value: hero
arguments:
- kind: argument
name:
kind: name
value: episode
value:
kind: enum
value: EMPIRE
- selectionSet:
selections:
- name:
kind: name
value: comparisonFields
kind: fragmentSpread
kind: selectionSet
kind: field
alias:
name:
kind: name
value: rightComparison
kind: alias
name:
kind: name
value: hero
arguments:
- kind: argument
name:
kind: name
value: episode
value:
kind: enum
value: JEDI
kind: selectionSet
- typeCondition:
name:
kind: name
value: Character
kind: namedType
selectionSet:
selections:
- name:
kind: name
value: name
kind: field
- selectionSet:
selections:
- name:
kind: name
value: totalCount
kind: field
- selectionSet:
selections:
- selectionSet:
selections:
- name:
kind: name
value: name
kind: field
kind: selectionSet
name:
kind: name
value: node
kind: field
kind: selectionSet
name:
kind: name
value: edges
kind: field
kind: selectionSet
arguments:
- kind: argument
name:
kind: name
value: first
value:
name:
kind: name
value: first
kind: variable
name:
kind: name
value: friendsConnection
kind: field
kind: selectionSet
name:
kind: name
value: comparisonFields
kind: fragmentDefinition
kind: document
...
```