GraphQL规范

news/2024/9/29 13:16:35/

GraphQL规范

  • 内置类型
  • 内置指令
  • 自省

对IDEA插件GraphQL生成的规范的总结。详细规范文档请参阅GraphQL规范

内置类型

  • ID: 表示唯一标识符,通常用于对象的重取或缓存键。
  • String: 表示文本数据,可读的字符串。
  • Boolean:布尔
  • Float:表示双精度浮点数。
  • Int: 整数

"""
The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache.
The ID type appears in a JSON response as a String; however, it is not intended to be human-readable.
When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
"""
scalar ID"""
The String scalar type represents textual data, represented as UTF-8 character sequences.
The String type is most often used by GraphQL to represent free-form human-readable text.
"""
scalar String"""
The Boolean scalar type represents true or false.
"""
scalar Boolean"""
The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.
"""
scalar Float"""
The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
"""
scalar Int

内置指令

  • @include: 允许在执行期间条件性地包含字段。
  • @skip: 允许在执行期间条件性地排除字段。
  • @deprecated: 指示某些部分已弃用,并提供原因。
  • @specifiedBy: 提供自定义标量的行为说明的URL。
"""
The @include directive may be provided for fields, fragment spreads, and inline fragments,
and allows for conditional inclusion during execution as described by the if argument.
"""
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT"""
The @skip directive may be provided for fields, fragment spreads, and inline fragments,
and allows for conditional exclusion during execution as described by the if argument.
"""
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT"""
The @deprecated directive is used within the type system definition language to indicate deprecated portions of a
GraphQL service's schema, such as deprecated fields, enum values, arguments or input fields.Deprecations include a reason for why it is deprecated, which is formatted using Markdown syntax (as specified by CommonMark).
"""
directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE"""
The @specifiedBy directive is used within the type system definition language
to provide a URL for specifying the behavior of custom scalar definitions.
"""
directive @specifiedBy(url: String!) on SCALAR

自省

对GraphQL服务的查询,使得客户端可以动态理解和查询GraphQL中定义的类型和结构。

graphql">
type __QueryIntrospectionMeta {__schema: __Schema!__type(name: String!): __Type
}type __TypeNameMeta {__typename: String!
}type __Schema {description: Stringtypes: [__Type!]!queryType: __Type!mutationType: __TypesubscriptionType: __Typedirectives: [__Directive!]!
}type __Type {kind: __TypeKind!name: Stringdescription: String"OBJECT and INTERFACE only"fields(includeDeprecated: Boolean = false): [__Field!]"OBJECT only"interfaces: [__Type!]"INTERFACE and UNION only"possibleTypes: [__Type!]"ENUM only"enumValues(includeDeprecated: Boolean = false): [__EnumValue!]"INPUT_OBJECT only"inputFields(includeDeprecated: Boolean = false): [__InputValue!]"NON_NULL and LIST only"ofType: __Type"May be non-null for custom SCALAR, otherwise null"specifiedByURL: String
}type __Field {name: String!description: Stringargs(includeDeprecated: Boolean = false): [__InputValue!]!type: __Type!isDeprecated: Boolean!deprecationReason: String
}type __InputValue {name: String!description: Stringtype: __Type!defaultValue: StringisDeprecated: Boolean!deprecationReason: String
}type __EnumValue {name: String!description: StringisDeprecated: Boolean!deprecationReason: String
}enum __TypeKind {SCALAR,OBJECT,INTERFACE,UNION,ENUM,INPUT_OBJECT,LIST,NON_NULL,
}type __Directive {name: String!description: Stringlocations: [__DirectiveLocation!]!args(includeDeprecated: Boolean = false): [__InputValue!]!isRepeatable: Boolean!
}enum __DirectiveLocation {QUERYMUTATIONSUBSCRIPTIONFIELDFRAGMENT_DEFINITIONFRAGMENT_SPREADINLINE_FRAGMENTVARIABLE_DEFINITIONSCHEMASCALAROBJECTFIELD_DEFINITIONARGUMENT_DEFINITIONINTERFACEUNIONENUMENUM_VALUEINPUT_OBJECTINPUT_FIELD_DEFINITION
}

http://www.ppmy.cn/news/1531931.html

相关文章

智能BI项目第六期

本期任务 分析系统现在的不足分布式消息队列分布式消息队列 RabbitMQ 入门实战 系统现状不足分析总结 让我们来讨论一下单机系统的问题。 现状:我们的异步处理是通过本地线程池实现的。 但是存在以下问题: 无法集中限制,仅能单机限制&a…

網路本地連接沒有有效的IP配置:原因與解決方法

網路本地連接顯示“沒有有效的IP配置”。這通常意味著你的電腦無法從路由器或其他網路設備獲取有效的IP地址,從而導致無法上網。本文將從原因和解決方法兩個方面,詳細解析這個問題。 一、問題的原因 路由器或數據機問題: 路由器或數據機出…

H5 随机身份证号码、社会统一信用代码、手机号、名字、银行卡号码

平时注册可能会用到这些,原本用自己服务器搭了个,感觉纯前端的还能引入到项目中挺好的,之后再追加一些常用的随机数据,这样写表单应该就会好测试了(●’◡’●)。 在线链接 https://linyisonger.github.io/H5.Examples/?name./07…

【RabbitMQ】RabbitMQ 的概念以及使用RabbitMQ编写生产者消费者代码

目录 1. RabbitMQ 核心概念 1.1生产者和消费者 1.2 Connection和Channel 1.3 Virtual host 1.4 Queue 1.5 Exchange 1.6 RabbitMO工作流程 2. AMQP 3.RabbitMO快速入门 3.1.引入依赖 3.2.编写生产者代码 ​3.3.编写消费者代码 4.源码 1. RabbitMQ 核心概念 在安装…

python的pyinstaller

1、pyinstaller --onefile -w *.py 可以生成可执行文件 -w就是不需要有console窗体出现、 2、 console窗体会出现一些警告。 比如 Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use: QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-scre…

使用Python实现图形学的环境映射算法

目录 使用Python实现图形学的环境映射算法引言1. 环境映射算法概述2. Python实现环境映射算法2.1 向量类2.2 环境纹理类2.3 材质类2.4 物体类2.5 环境映射器类2.6 使用示例 3. 实例分析4. 环境映射算法的优缺点4.1 优点4.2 缺点 5. 改进方向6. 应用场景结论 使用Python实现图形…

商家营销工具架构升级总结

今年以来,商家营销工具业务需求井喷,需求数量多且耗时都比较长,技术侧面临很大的压力。因此这篇文章主要讨论营销工具前端要如何应对这样大规模的业务需求。 问题拆解 我们核心面对的问题主要如下: 1. 人力有限 我们除了要支撑存量…

【CKA】一、基于角色的访问控制-RBAC

1、基于角色的访问控制-RBAC 1. 考题内容: 2. 答题思路: 这道题就三条命令,建议直接背熟就行。 也可以查看帮助 kubectl create clusterrole -h kubectl create serviceaccount -h kubectl create rolebinding -h 注意: 1、资…