【文件属性】:
文件名称:graphql-ruby:如何使用GraphQL的GraphQL Ruby示例
文件大小:44KB
文件格式:ZIP
更新时间:2021-02-01 06:28:11
ruby rails graphql tutorial graphql-server
graphql-ruby
安装
安装依赖项:
bundle install
rails db:setup
启动服务器:
rails server
打开应用程序:
open http://localhost:3000/
有趣的文件:
-GraphQL控制器(API入口点)
模式定义
-根突变
-根查询
记录类型
记录类型
记录类型
标量类型
复杂的搜索解析器及其
变异及其
变异及其
变异及其
变异及其
样本GraphQL查询
列出前10个链接,其中包含“示例”:
{
allLinks ( first : 10 , filter : { descriptionContains : " example " }) {
id
url
description
createdAt
postedBy {
id
name
}
}
}
创建新用户:
mutation {
createUser (
name : " Radoslav Stankov " ,
authProvider : {
【文件预览】:
graphql-ruby-master
----.gitignore(536B)
----app()
--------graphql()
--------assets()
--------models()
--------controllers()
----config.ru(130B)
----package.json(70B)
----bin()
--------rails(141B)
--------setup(1KB)
--------bundle(125B)
--------update(819B)
--------yarn(303B)
--------rake(90B)
----log()
--------.keep(0B)
----.rubocop.yml(762B)
----db()
--------migrate()
--------seeds.rb(95B)
--------schema.rb(2KB)
----.ruby-version(6B)
----public()
--------robots.txt(98B)
--------apple-touch-icon.png(0B)
--------422.html(2KB)
--------apple-touch-icon-precomposed.png(0B)
--------favicon.ico(0B)
--------500.html(2KB)
--------404.html(2KB)
----LICENSE.txt(1KB)
----README.md(3KB)
----vendor()
--------.keep(0B)
----config()
--------cable.yml(193B)
--------spring.rb(97B)
--------boot.rb(207B)
--------secrets.yml(1KB)
--------database.yml(594B)
--------routes.rb(226B)
--------environments()
--------environment.rb(128B)
--------application.rb(815B)
--------storage.yml(1KB)
--------puma.rb(2KB)
--------initializers()
----lib()
--------tasks()
----Gemfile(763B)
----Rakefile(227B)
----test()
--------graphql()
--------factories()
--------test_helper.rb(258B)
----Gemfile.lock(5KB)