Skip to content

Commit 7c865c1

Browse files
committed
update readme
* Changes installation instruction * Fix example to conform Tarantool Lua Styleguide * Fix features list (we use luagraphqlparser in contrast of original module) * Fix instruction for running tests (currently they are implemented in luatest)
1 parent 2c250e9 commit 7c865c1

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
Lua implementation of GraphQL for Tarantool
22
===========================================
33

4-
Lua implementation of GraphQL for Tarantool. It is based on [graphql-lua](https://github.com/bjornbytes/graphql-lua).
4+
Lua implementation of GraphQL for Tarantool.
5+
It is based on [graphql-lua](https://github.com/bjornbytes/graphql-lua).
56

67

78
Installation
89
------------
910

1011
```bash
11-
tarantoolctl rocks install https://github.com/raw/tarantool/graphql/master/graphql-scm-1.rockspec
12+
tarantoolctl rocks install graphql
1213
```
1314

1415
Example
1516
---
1617

1718
```lua
18-
local parse = require 'graphql.parse'
19-
local schema = require 'graphql.schema'
20-
local types = require 'graphql.types'
21-
local validate = require 'graphql.validate'
22-
local execute = require 'graphql.execute'
19+
local parse = require('graphql.parse')
20+
local schema = require('graphql.schema')
21+
local types = require('graphql.types')
22+
local validate = require('graphql.validate')
23+
local execute = require('graphql.execute')
2324

2425
-- Parse a query
2526
local ast = parse [[
@@ -32,7 +33,7 @@ query getUser($id: ID) {
3233
]]
3334

3435
-- Create a type
35-
local Person = types.object {
36+
local Person = types.object({
3637
name = 'Person',
3738
fields = {
3839
id = types.id.nonNull,
@@ -41,11 +42,11 @@ local Person = types.object {
4142
lastName = types.string.nonNull,
4243
age = types.int.nonNull
4344
}
44-
}
45+
})
4546

4647
-- Create a schema
47-
local schema = schema.create {
48-
query = types.object {
48+
local schema = schema.create({
49+
query = types.object({
4950
name = 'Query',
5051
fields = {
5152
person = {
@@ -65,8 +66,8 @@ local schema = schema.create {
6566
end
6667
}
6768
}
68-
}
69-
}
69+
})
70+
})
7071

7172
-- Validate a parsed query against a schema
7273
validate(schema, ast)
@@ -91,21 +92,20 @@ execute(schema, ast, rootValue, variables, operationName)
9192
Status
9293
---
9394

94-
- [x] Parsing
95-
- [ ] Improve error messages
95+
- [x] Parsing (based on [luagraphqlparser](https://github.com/tarantool/luagraphqlparser))
9696
- [x] Type system
9797
- [x] Introspection
9898
- [x] Validation
9999
- [x] Execution
100100
- [ ] Asynchronous execution (coroutines)
101-
- [ ] Example server
102101

103102
Running tests
104103
---
105104

106105
```bash
107-
tarantoolctl rocks make # optionally
108-
tarantool tests/runner.lua
106+
tarantoolctl rocks make
107+
tarantoolctl rocks install luatest 0.5.2
108+
.rocks/bin/luatest
109109
```
110110

111111
License

0 commit comments

Comments
 (0)