graphql-patterns — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited graphql-patterns (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Any task involving GraphQL schema design, resolver implementation, DataLoader usage, subscriptions, federation, or GraphQL performance optimization.
Entity types:
type User {
id: ID!
email: String!
name: String!
createdAt: DateTime!
orders(first: Int, after: String): OrderConnection!
}Input types for mutations:
input CreateUserInput {
email: String!
name: String!
password: String!
}
type CreateUserPayload {
user: User
errors: [ValidationError!]!
}Enum for fixed sets:
enum OrderStatus {
PENDING
PROCESSING
SHIPPED
DELIVERED
CANCELLED
}Rules:
The problem:
Query: { users { orders { items } } }
1 query for users
N queries for orders (one per user)
N*M queries for items (one per order)The solution — DataLoader:
const orderLoader = new DataLoader(async (userIds) => {
// ONE query for ALL user IDs
const orders = await db.orders.findMany({ where: { userId: { in: userIds } } });
// Map results back to the correct user
return userIds.map(id => orders.filter(o => o.userId === id));
});
// In resolver
resolve(user) {
return orderLoader.load(user.id);
}Rules:
type OrderConnection {
edges: [OrderEdge!]!
pageInfo: PageInfo!
totalCount: Int
}
type OrderEdge {
node: Order!
cursor: String!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}Implementation:
base64(id:123)).first + after (cursor).last + before (cursor).Transport: WebSocket (graphql-ws protocol).
Design rules:
Example:
type Subscription {
orderStatusChanged(orderId: ID!): Order!
newMessage(channelId: ID!): Message!
}Backend:
Split schema by domain team:
# Users service
type User @key(fields: "id") {
id: ID!
email: String!
name: String!
}
# Orders service (extends User from users service)
extend type User @key(fields: "id") {
id: ID! @external
orders: [Order!]!
}Rules:
@key directive defines how entities are referenced across services.__resolveReference for federated entities.How it works:
Benefits:
Implementation:
graphql-codegen or relay-compiler to extract and hash.type Mutation {
createOrder(input: CreateOrderInput!): CreateOrderPayload!
}
type CreateOrderPayload {
order: Order
errors: [UserError!]!
}
type UserError {
field: [String!]
message: String!
code: ErrorCode!
}Rules:
errors field for expected user errors (validation, business logic).errors array) only for unexpected failures.HTTP caching (persisted queries via GET):
Normalized client cache (Apollo Client, urql):
__typename + id.cache.evict() for deletions.Server-side (DataLoader per-request + Redis):
graphql-codegen.@graphql-codegen/typescript-react-apollo.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.