tarantool / graphqlapi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tarantool GraphQL API module

General description

Module based on:

CAUTION: Since this module is under heavy development it is not recommended to use on production environments and also API and functionality in future releases may be changed without backward compatibility!

Install pre-built rock

Simply run from the root of Tarantool App root the following:

    cd <tarantool-application-dir>
    tarantoolctl rocks install graphqlapi

Lua API

GraphQL API module has a several submodules. Each of submodule has an API that described in the following docs:

Simple start

  1. Install the following modules to your app:
    cd <tarantool-application-dir>
    
    # install GraphQL IDE
    tarantoolctl rocks install graphqlide

    # install GraphQL API
    tarantoolctl rocks install graphqlapi

    # install GraphQL API Helpers (available only for Tarantool Enterprise SDK users)
    tarantoolctl rocks install graphqlapi-helpers
  1. Add dependent roles to router custom role:
    ...
    dependencies = {
        ...
        'cartridge.roles.graphqlide',
        'cartridge.roles.graphqlapi',
    },
    ...
  1. Add helpers to init() router custom role:
local function init(opts) -- luacheck: no unused args
    -- if opts.is_master then
    -- end

    spaces.init({ schema = 'Spaces' })
    data.init({ schema = 'Data' })

    return true
end
  1. Add custom fragments (if need some) to ./fragments dir.

Examples

For simple example of using this module refer to: GraphQL API simple example

For fully featured example of using this module refer to: GraphQL API full featured example

About


Languages

Language:Lua 99.1%Language:CMake 0.8%Language:Shell 0.0%