Skip to content

Add Object, Interface, and Input type components with tests#80

Draft
FionaBronwen wants to merge 2 commits intofionabronwen/graphql-components-1from
fionabronwen/graphql-components-2
Draft

Add Object, Interface, and Input type components with tests#80
FionaBronwen wants to merge 2 commits intofionabronwen/graphql-components-1from
fionabronwen/graphql-components-2

Conversation

@FionaBronwen
Copy link
Copy Markdown

@FionaBronwen FionaBronwen commented Apr 12, 2026

Summary

Adds the field-bearing type components that use the Field infrastructure from the earlier PR.

  • ObjectType: Renders type definitions with fields, @compose interface implementations, and @operationFields support.
  • InterfaceType: Renders interface definitions with fields.
  • InputType: Renders input definitions with fields. Automatically appends Input suffix when a model appears in both input and output positions (checked via modelVariants context).
  • 17 new tests covering field rendering, doc comments, optional/nullable fields, array/list types, deprecated fields, @compose interface implementation, and Input suffix logic.

Test plan

  • npm run build succeeds
  • npm test — 165 tests pass (148 prior + 17 new)

@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-1 branch from d5eb811 to 9ce5acc Compare April 13, 2026 00:10
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from aa5f67f to 915dfa1 Compare April 13, 2026 00:10
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-1 branch from 9ce5acc to e8903e3 Compare April 14, 2026 21:56
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from 915dfa1 to 292ff4b Compare April 14, 2026 21:56
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-1 branch from e8903e3 to 46bd2fe Compare April 14, 2026 22:06
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from 292ff4b to e647811 Compare April 14, 2026 22:06
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-1 branch 2 times, most recently from f379460 to c9c7af2 Compare April 21, 2026 16:26
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from e647811 to 79f53c2 Compare April 21, 2026 16:27
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-1 branch from c9c7af2 to 4178df3 Compare April 21, 2026 20:25
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch 2 times, most recently from 41fbefb to 8a187c4 Compare April 21, 2026 20:43
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-1 branch from 4178df3 to 5195591 Compare April 21, 2026 20:43
Add field-bearing type components that use the Field infrastructure
(already present from the parent branch):
- ObjectType: renders object types with fields, @compose interfaces,
  and @operationFields support
- InterfaceType: renders interface type definitions with fields
- InputType: renders input types with automatic Input suffix when a
  model appears in both input and output positions

17 new component tests covering: basic field rendering, doc comments,
optional/nullable fields, array/list types, deprecated fields,
interface implementation via @compose, and Input suffix logic.
…ed imports

- Add explanatory comment on getComposition/iface.name in object-type.tsx
  clarifying that pre-mutation names match post-mutation names (mutation
  engine doesn't rename models)
- Remove unused `type Model` import from all G2 test files
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-1 branch from 5195591 to c288111 Compare April 22, 2026 17:09
@FionaBronwen FionaBronwen force-pushed the fionabronwen/graphql-components-2 branch from 8a187c4 to ffa9c95 Compare April 22, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant