# learn-graphql **Repository Path**: xut0793/learn-graphql ## Basic Information - **Project Name**: learn-graphql - **Description**: GraphQL 学习 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-12-23 - **Last Updated**: 2024-04-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GraphQL 实战 ## 基础知识 - [x] 三种操作 - [x] 查询 - [x] 变更 - [x] 订阅 - [x] 类型系统 schema - [x] 对象类型和字段 - [x] 标量类型 - [x] 内置标量类型 - [x] 自定义标量类型 - [x] 枚举类型 - [x] 列表和非空 - [x] 联合类型 - [x] 接口类型 - [x] 输入类型和别名 - [x] 片段 - [x] 指令 - [x] 内置指令 - [x] 客户侧:@include @skip - [x] 服务侧:@deprecated - [x] 自定义指令 - [x] resolver 解析器 - [x] 根解析器 - [x] 字段解析器 - [x] 参数和变量 - [x] 客户端和服务端 schema 细微区别 - [x] 分页 - [x] 上传文件 - [x] 缓存 - [x] 认证、授权和鉴权 - [x] 安全 - [x] 设置请求超时时间 - [x] 限制数据量 - [x] 限制查询深度 - [x] 限制查询复杂度 - [x] schema 开发优先 ## 实践路径 - [x] graphql.js 的 Hello World - [x] graphql constructing type - [x] graphql schema type, 需要借助 @graphql-tools/schema,自定义指令还要借助 @graphql-tools/utils - [x] 建立服务器 - [x] graphql-http 独立服务的方式 - [x] graphql-http 与 express 集成的方式 - [x] @apollo/server - [x] standalone - [x] express - [x] @apollo/client - [x] Vue Apollo ## 实现功能 - [x] User 用户 - [x] name 自定义指令 uppercase - [x] birthday 自定义标量类型 DateTime - [x] gender 枚举 - [x] jwt 认证,附加到上下文对象 - [x] 单个用户查询 参数 - [x] avatar 上传照片 Upload - [x] 列表查询 分页 ```graphql scalar Date scalar Upload enum Gender { Male Female } type User { id: ID! name: String! @uppercase gender: Gender! birthday: Date avatar: String! desc: String! } ``` ## 实践总结 [GraphQL 入门指北](./graphql-1-learn.md) [GraphQL 类型系统](./graphql-2-type-system.md) ## 库的链接 - [GraphQL 中文官网](https://graphql.cn/) - [graphql.js](https://graphql.cn/graphql-js/) - [graphql-http.js]() - [graphql-tools.js](https://the-guild.dev/graphql/tools/docs/introduction) - [@apollo/server v4](https://www.apollographql.com/docs/apollo-server/) - [Vue GraphQL](https://apollo.vuejs.org/zh-cn/guide-composable/subscription.html) - [graphql-multipart-request-spec 文件上传规范](https://github.com/jaydenseric/graphql-multipart-request-spec) - [graphql-upload](https://github.com/jaydenseric/graphql-upload/tree/master) - [apollo-upload-client](https://github.com/jaydenseric/apollo-upload-client/tree/master)