算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
graphql-schema【设计与创意】Guide for designing and changing GraphQL schemas following industry best practices. Use this skill whenever you create or edit GraphQL SDL, such as a `schema.graphql` file or `typeDefs`, including when: (1) designing a new GraphQL schema or API, (2) adding or changing types, fields, arguments, mutations, or descriptions in an existing schema, (3) rev…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
schema.graphql file or typeDefs, including when:
(1) designing a new GraphQL schema or API,
(2) adding or changing types, fields, arguments, mutations, or descriptions in an existing schema,
(3) reviewing existing schema for improvements,
(4) deciding on type structures or nullability,
(5) implementing pagination or error patterns,
(6) ensuring security in schema design.
license: MIT
compatibility: Any GraphQL implementation (Apollo Server, graphql-js, Yoga, etc.)
metadata:
author: apollographql
version: "1.0.2"
allowed-tools: Bash(npm:) Bash(npx:) Read Write Edit Glob GrepThis guide covers best practices for designing GraphQL schemas that are intuitive, performant, and maintainable. Schema design is primarily a server-side concern that directly impacts API usability.
"""
A user in the system.
"""
type User {
id: ID!
email: String!
name: String
posts(first: Int = 10, after: String): PostConnection!
createdAt: DateTime!
}
| Pattern | Meaning |
|---|---|
| String | Nullable - may be null |
| String! | Non-null - always has value |
| [String] | Nullable list, nullable items |
| [String!] | Nullable list, non-null items |
| [String]! | Non-null list, nullable items |
| [String!]! | Non-null list, non-null items |
Best Practice: Use [Type!]! for lists - empty list over null, no null items.
# Output type - what clients receive
type User {
id: ID!
email: String!
createdAt: DateTime!
}
# Input type - what clients send
input CreateUserInput {
email: String!
name: String
}
# Mutation using input type
type Mutation {
createUser(input: CreateUserInput!): User!
}
interface Node {
id: ID!
}
type User implements Node {
id: ID!
email: String!
}
type Post implements Node {
id: ID!
title: String!
}
union SearchResult = User | Post | Comment
type Query {
search(query: String!): [SearchResult!]!
}
Detailed documentation for specific topics:
mutation(input: InputType!)Node interface for refetchabilityQuery.users or Post.comments: return a connection and give first a default page sizeID type for identifiers, not String or Int