[codex] Add explicit interface implements#44
Conversation
764b3ba to
8c19204
Compare
|
@codex review |
|
Codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c19204b20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| interfaceField.args | ||
| |> List.iter (fun (interfaceArg : gqlArg) -> | ||
| match findArgByName implementationField.args interfaceArg.name with | ||
| | None -> |
There was a problem hiding this comment.
Ignore injected resolver args in interface arg parity checks
Validate only GraphQL-exposed arguments when comparing interface field signatures. This loop compares every raw resolver arg, so injected args like InjectContext, InjectInfo, or InjectInterfaceTypename are treated as schema arguments and can incorrectly produce "missing argument" errors when an override omits an injected parameter. That rejects valid implementations even though these args are intentionally non-printable and not part of the GraphQL contract.
Useful? React with 👍 / 👎.
| implementationField.args | ||
| |> List.iter (fun (implementationArg : gqlArg) -> | ||
| match findArgByName interfaceField.args implementationArg.name with | ||
| | Some _ -> () | ||
| | None -> | ||
| if isRequiredInputType implementationArg.typ then |
There was a problem hiding this comment.
Exclude injected args from extra-required-argument validation
This check also runs on raw resolver arguments, so internal injected args are considered user-facing field arguments. If an implementing resolver includes ~ctx/~info while the interface field does not, it is flagged as adding a required argument, even though injected args are not GraphQL inputs. This creates false-positive validation failures for otherwise valid interface implementations.
Useful? React with 👍 / 👎.
8c19204 to
456d284
Compare
|
Codex review |
456d284 to
746dc6f
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Adds repeatable
@gql.implements("InterfaceName")for object types and interfaces, while preserving the existing record-spread interface mechanism.The new explicit path records implementation declarations separately from spreads, attaches them during schema processing without copying interface fields into the ReScript record, expands transitive parent interfaces required by GraphQL.js, and validates implementation parity before generated schema code is emitted.
README and interface docs now cover the explicit API alongside the existing spread style.
Validation covered
@gql.implementspayload@gql.implementstarget rejectionChecks
make formatmake testmake -C tests test