

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345## Context67This instruction file applies to GraphQL schema files and resolver implementations. The project follows a **schema-first** design: the `.graphql` / `.graphqls` schema file is the contract; resolver code is generated or implemented to satisfy it. The server uses Spring for GraphQL (Java) or Apollo Server / GraphQL-Yoga (TypeScript). N+1 query prevention via DataLoader is mandatory. Depth and complexity limiting is required in all production environments.89---1011## Coding Standards1213- **Schema-first:** Define the schema in `.graphql` files before writing any resolver code14- **Mutation payload types:** Every mutation returns a dedicated payload type with an `errors` field — never return the entity directly15- **No `input` reuse across mutations:** Each mutation has its own `input` type — never share `CreateOrderInput` between create and update16- **DataLoader mandatory:** Any resolver that loads a related entity must use a DataLoader — never call a repository in a loop17- **Cursor-based pagination:** Use Relay-spec `Connection` / `Edge` / `PageInfo` types — never offset-based `skip`/`limit`18- **Deprecate, never remove:** Mark unused fields `@deprecated(reason: "...")` and keep for one API lifecycle — never delete a field from a live schema19- **Depth limit:** Maximum query depth of 7 in production; enforced by `graphql-java-extended-scalars` or `graphql-depth-limit`20- **Complexity limit:** Maximum complexity of 200 per query; each field contributes 1 by default, connections contribute 102122---2324## Preferred Patterns2526### Schema Design2728```graphql29# ✅ CORRECT — mutation payload with errors, dedicated input type30type Mutation {31 placeOrder(input: PlaceOrderInput!): PlaceOrderPayload!32 cancelOrder(input: CancelOrderInput!): CancelOrderPayload!33}3435input PlaceOrderInput {36 customerId: ID!37 items: [OrderLineItemInput!]!38 currency: Currency!39}4041type PlaceOrderPayload {42 order: Order43 errors: [UserError!]!44}4546type UserError {47 message: String!48 field: [String!]49 code: String!50}5152# ✅ CORRECT — Relay cursor pagination53type OrderConnection {54 edges: [OrderEdge!]!55 pageInfo: PageInfo!56 totalCount: Int!57}5859type OrderEdge {60 node: Order!61 cursor: String!62}6364type PageInfo {65 hasNextPage: Boolean!66 hasPreviousPage: Boolean!67 startCursor: String68 endCursor: String69}7071# ❌ WRONG — mutation returns entity directly, no error handling72type Mutation {73 placeOrder(customerId: ID!, items: [OrderLineItemInput!]!): Order74}7576# ❌ WRONG — offset-based pagination77type Query {78 orders(skip: Int, limit: Int): [Order!]!79}80```8182### DataLoader (N+1 Prevention)8384```java85// ✅ CORRECT — Spring for GraphQL DataLoader registration86@Component87public class CustomerDataLoader {8889 @Bean90 public BatchLoaderRegistry batchLoaderRegistry(CustomerRepository repo) {91 return BatchLoaderRegistry.builder()92 .forTypePair(String.class, Customer.class)93 .registerMappedBatchLoader("customerLoader",94 (customerIds, env) -> Mono.fromCompletionStage(95 repo.findAllByIds(customerIds)96 .thenApply(customers -> customers.stream()97 .collect(Collectors.toMap(c -> c.getId().toString(), c -> c)))98 ))99 .build();100 }101}102103// ✅ CORRECT — resolver uses DataLoader, not direct repo call104@SchemaMapping(typeName = "Order", field = "customer")105public CompletableFuture<Customer> customer(Order order, DataLoader<String, Customer> customerLoader) {106 return customerLoader.load(order.getCustomerId().toString());107}108109// ❌ WRONG — N+1: calls repo once per Order110@SchemaMapping(typeName = "Order", field = "customer")111public Customer customer(Order order) {112 return customerRepository.findById(order.getCustomerId()).orElseThrow();113}114```115116### TypeScript Resolver (Apollo Server)117118```typescript119// ✅ CORRECT — resolver with DataLoader, typed context120import DataLoader from "dataloader";121122const resolvers = {123 Order: {124 customer: async (order: Order, _args: never, ctx: Context): Promise<Customer> => {125 return ctx.loaders.customer.load(order.customerId);126 },127 },128 Mutation: {129 placeOrder: async (_root: never, { input }: PlaceOrderArgs, ctx: Context): Promise<PlaceOrderPayload> => {130 try {131 const order = await ctx.orderService.place(input);132 return { order, errors: [] };133 } catch (err) {134 return { order: null, errors: [{ message: (err as Error).message, code: "ORDER_FAILED", field: null }] };135 }136 },137 },138};139```140141---142143## Anti-Patterns — Do NOT Generate144145```graphql146# WRONG: mutation returns entity directly — no error handling [BLOCKER]147type Mutation {148 placeOrder(customerId: ID!, items: [OrderLineItemInput!]!): Order!149}150151# WRONG: shared input type across mutations [MAJOR]152input OrderInput {153 id: ID154 customerId: ID155 items: [OrderLineItemInput!]156}157158# WRONG: offset pagination — inconsistent on fast-moving datasets [MAJOR]159type Query {160 orders(skip: Int!, limit: Int!): [Order!]!161}162163# WRONG: removing a field without deprecation period [MAJOR]164# (deleted field that was previously in schema)165166# WRONG: field named with implementation details [MINOR]167type Order {168 mysqlId: Int! # exposes storage detail169}170```171172```java173// WRONG: N+1 — repository call inside a per-entity resolver [BLOCKER]174@SchemaMapping(typeName = "Order", field = "customer")175public Customer customer(Order order) {176 return customerRepository.findById(order.getCustomerId()).orElseThrow();177}178```179180---181182## Dependencies & Versions183184| Technology | Version | Notes |185|-----------|---------|-------|186| Spring for GraphQL | 1.3+ | `@QueryMapping`, `@SchemaMapping`, `@MutationMapping` |187| graphql-java | 21+ | `BatchLoaderRegistry` for DataLoader integration |188| graphql-java-extended-scalars | 22+ | `Date`, `DateTime`, `JSON`, depth/complexity limiting |189| Apollo Server | 4.x | TypeScript; `ApolloServerPlugin` for complexity limits |190| DataLoader (npm) | 2.x | Batch + cache loader for N+1 prevention |191| graphql-depth-limit (npm) | 1.x | `depthLimit(7)` validation rule |192193---194195## Test Conventions196197- Test resolvers with `GraphQlTester` (Spring) or `ApolloServer.executeOperation` (TypeScript) — not raw HTTP198- Test DataLoader batching: assert the repository `findAllByIds` is called once even when 10 orders are resolved199- Test mutation error paths: verify `errors` field is populated and `order` is null on failure200- Test pagination: verify `hasNextPage`, `endCursor`, and correct `edges` count for a given `first` value201- Test depth limiting: submit a deeply nested query (depth > 7) and assert a validation error is returned202- Test complexity limiting: submit a query exceeding complexity 200 and assert rejection203
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| doubts-suplab/eeik-bootstrap.clinerules/golden-rules.md · 1 | Cline rules | gitsecuritydo-not | 61/100 | today | |
| doubts-suplab/eeik-bootstrap.clinerules/project.md · 1 | Cline rules | teststylegit | 63/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/architecture.mdc · 1 | Cursor rules | do-not | 52/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/capabilities.mdc · 1 | Cursor rules | teststylegit | 58/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/golden-rules.mdc · 1 | Cursor rules | gitsecuritydo-not | 61/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/python.mdc · 1 | Cursor rules | lint-formatstyletypesapi+1 | 77/100 | today | |
| doubts-suplab/eeik-bootstrap.cursor/rules/security.mdc · 1 | Cursor rules | security | 39/100 | today | |
| doubts-suplab/eeik-bootstrap.github/copilot-instructions.md · 1 | Copilot instructions | lint-formatstyletesting-strategygit+2 | 54/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/a2a-protocol.instructions.md · 1 | Copilot instructions | styleagent-behaviour | 48/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/ai-governance.instructions.md · 1 | Copilot instructions | stylearchdo-notagent-behaviour | 61/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/angular.instructions.md · 1 | Copilot instructions | teststyletypestesting-strategy+4 | 69/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/architecture-governance.instructions.md · 1 | Copilot instructions | testlint-formatstylegit+4 | 65/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/autogen.instructions.md · 1 | Copilot instructions | typessecurityagent-behaviour | 50/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/aws-architecture.instructions.md · 1 | Copilot instructions | styletypessecurityperformance | 58/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/aws-data-ml-ai.instructions.md · 1 | Copilot instructions | deployment | 54/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/cdk-terraform.instructions.md · 1 | Copilot instructions | teststylearchtypes+2 | 96/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/cicd.instructions.md · 1 | Copilot instructions | stylesecuritydeploymentdo-not+1 | 65/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/containerisation.instructions.md · 1 | Copilot instructions | buildstylesecuritydo-not | 77/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/crewai.instructions.md · 1 | Copilot instructions | styleagent-behaviour | 48/100 | today | |
| doubts-suplab/eeik-bootstrap.github/instructions/data-engineering.instructions.md · 1 | Copilot instructions | teststyletypesgit+5 | 69/100 | today |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 65 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 14 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 14 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 14 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 14 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 13 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 32k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/doubts-suplab-eeik-bootstrap-github-instructions-graphql-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.