Graphql介绍(Introduction to GraphQL)
Introduction to GraphQL
me) as well as that User's name might look something like this:type Query {
me: User
}
type User {
id: ID
name: String
}
Along with functions for each field on each type:
以及每一个字段的每个类型的函数:
function Query_me(request) {
return request.auth.user;
}
function User_name(user) {
return user.getName();
}
Once a GraphQL service is running (typically at a URL on a web service), it can be sent GraphQL queries to validate and execute. A received query is first checked to ensure it only refers to the types and fields defined, then runs the provided functions to produce a result.
一旦一个GraplQl服务在运行(尤其是在一个web服务器上的URL地址),它将会发送GraphQL查询去验证和执行。一个接收到的查询首先去检查并确保它仅仅是引用定义的type和fields,之后再运行提供的函数去生成一个结果。
For example the query:
例如:
{
me {
name
}
}
Could produce the JSON result:
将产生的JSON结果:
{
"me": {
"name": "Luke Skywalker"
}
}
Learn more about GraphQL: the query language, type system, how the GraphQL service works, and as well as best practices for using GraphQL to solve common problems in the articles written in this section.
学习更多的关于GraphQl:查询语言,type系统,GraphQl服务如何工作,以及使用GraphQl去解决这个文章中的通用问题的最佳实践。
Graphql介绍(Introduction to GraphQL)的更多相关文章
- GraphQL介绍&使用nestjs构建GraphQL查询服务
GraphQL介绍&使用nestjs构建GraphQL查询服务(文章底部附demo地址) GraphQL一种用为你 API 而生的查询语言.出自于Facebook,GraphQL非常易懂,直接 ...
- ASP.NET Core中使用GraphQL - 第九章 在GraphQL中处理多对多关系
ASP.NET Core中使用GraphQL ASP.NET Core中使用GraphQL - 第一章 Hello World ASP.NET Core中使用GraphQL - 第二章 中间件 ASP ...
- iOS: 属性列表介绍 Introduction to Property Lists
iOS: 属性列表介绍 Introduction to Property Lists 从本质上说, 属性列表就是苹果的对象数据序列化与反序列化方式 属性列表使用几种数据类型把数据组织为键值表和值表 P ...
- 【线性代数】6-1:特征值介绍(Introduction to Eigenvalues)
title: [线性代数]6-1:特征值介绍(Introduction to Eigenvalues) categories: Mathematic Linear Algebra keywords: ...
- ASP.NET Core中使用GraphQL - 第八章 在GraphQL中处理一对多关系
ASP.NET Core中使用GraphQL - 目录 ASP.NET Core中使用GraphQL - 第一章 Hello World ASP.NET Core中使用GraphQL - 第二章 中间 ...
- [GraphQL] Query GraphQL Interface Types in GraphQL Playground
Interfaces are similar to Unions in that they provide a mechanism for dealing with different types o ...
- GraphQL 01--- GraphQL 介绍及资源总结
作为一位web开发人员,在使用REST API的时候,是否遇到过这样的问题: 1.调用一个API的时候,总是会返回一些不需要的信息. 2. 对于一个资源的调用,如果想获取到更多的信息,可能需要发送多次 ...
- 使用Hot Chocolate和.NET 6构建GraphQL应用(1)——GraphQL及示例项目介绍
系列导航 使用Hot Chocolate和.NET 6构建GraphQL应用文章索引 前言 这篇文章是这个系列的第一篇,我们会简单地讨论一下GraphQL,然后介绍一下这个系列将会使用的示例项目. 关 ...
- 5个用/不用GraphQL的理由
我在如何使用Gatsby建立博客 / How to build a blog with Gatsby这篇文章中提过GraphQL在Gatsby中的应用.总的来讲,它是一个新潮的技术,在适宜的使用场景威 ...
随机推荐
- tools:context=".MainActivity的作用(转)
android:layout_width="match_parent" android:layout_height="match_parent" android ...
- view类的setVisibility
android view setVisibility():有三个参数:Parameters:visibility One of VISIBLE, INVISIBLE, or GONE,想对应的三个常量 ...
- 设置输入域(input/textarea)中文本光标的位置
以前记录了一篇 将光标定位于输入框最右侧的实现方式 ,实现光标定位在文本的最末.这种需求往往在修改现有的文本.有时可能还需要把光标定位在首位,或者中间某个位置,这就需要实现一个更通用的方法. 这个方法 ...
- vs2008环境nmake编译 apache 2.2.29 openssl 1.0.1g mod_ssl 不知道如何生成“"..\..\srclib\openssl\inc32\openssl\store.h"”
问题: vs2008环境nmake编译 apache 2.2.29 openssl 1.0.1g mod_ssl 不知道如何生成“"..\..\srclib\openssl\inc32\op ...
- UEFI安装Kali Linux 1.1.0记录
现在使用Kali Linux 1.1.0, UEFI启动,使用Fcitx的拼音输入法,词库实在不爽,将就写一写. 本文地址: http://www.cnblogs.com/go2bed/p/42954 ...
- [转]NopCommerce 多数据库方案
本文转自:http://www.cnblogs.com/YUTOUYUWEI/p/5538200.html 有时候一个项目需要连接多个数据库,以实现不同数据库的数据在同个项目的共享. 如果已经安装了n ...
- 详细说说 Google Test Certified 的各级——Level 2,3
转载请联系作者,谢谢! No releases with red tests基于Level1搭建的持续集成,持续发布选用的CL(changelist)就可以取自CI系统最后跑通的CL,因为持续集成 ...
- Hibernate一对一关联映射配置
一.一对一关联 Hibernate提供了两种映射一对一关联关系的方式:按照外键映射和按照主键映射.下面以员工账号和员工档案表为例,介绍这两种映射方式,并使用这两种映射方式分别完成以下持久化操作: (1 ...
- AC日记——字符串P型编码 openjudge 1.7 31
31:字符串p型编码 总时间限制: 1000ms 内存限制: 65536kB 描述 给定一个完全由数字字符('0','1','2',…,'9')构成的字符串str,请写出str的p型编码串.例如: ...
- HOLOLENS的空间管理
http://blog.csdn.net/sun_t89/article/details/52460272