Skip to content

Commit

Permalink
interfaceObject <3
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela committed Mar 15, 2024
1 parent 47b155d commit b9390e9
Show file tree
Hide file tree
Showing 50 changed files with 2,976 additions and 1,497 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-steaks-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theguild/federation-composition': minor
---

Support @interfaceObject directive
5 changes: 5 additions & 0 deletions .changeset/slimy-ads-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theguild/federation-composition': patch
---

Improve INTERFACE_KEY_MISSING_IMPLEMENTATION_TYPE
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,31 +179,18 @@ Your feedback and bug reports are welcome and appreciated.
-`REQUIRES_DIRECTIVE_IN_FIELDS_ARG`
-`TYPE_DEFINITION_INVALID`
-`OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE`
-`INTERFACE_OBJECT_USAGE_ERROR`
-`REQUIRED_INACCESSIBLE`
-`SATISFIABILITY_ERROR`

### TODOs

- [ ] `INTERFACE_OBJECT_USAGE_ERROR`
- [ ] `INTERFACE_FIELD_NO_IMPLEM`
- [ ] `SATISFIABILITY_ERROR`
- [ ] `DISALLOWED_INACCESSIBLE`
- [ ] `DOWNSTREAM_SERVICE_ERROR`
- [ ] `EXTERNAL_ARGUMENT_DEFAULT_MISMATCH`
- [ ] `EXTERNAL_ARGUMENT_TYPE_MISMATCH`
- [ ] `EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE`
- [ ] `IMPLEMENTED_BY_INACCESSIBLE`
- [ ] `INVALID_FEDERATION_SUPERGRAPH`
- [ ] `LINK_IMPORT_NAME_MISMATCH`
- [ ] `REQUIRED_INACCESSIBLE`
- [ ] `SHAREABLE_HAS_MISMATCHED_RUNTIME_TYPES`
- [ ] `UNSUPPORTED_FEATURE`
- [ ] `UNSUPPORTED_LINKED_FEATURE`
- [ ] `TYPE_WITH_ONLY_UNUSED_EXTERNAL`
- [ ] `SATISFIABILITY_ERROR` - deeply nested key fields
- [ ] `SATISFIABILITY_ERROR` - fragments in keys
- [ ] `SATISFIABILITY_ERROR` - support interfaces... (kill me)
- [ ] `SATISFIABILITY_ERROR` - @require - check if fields defined by @require can be resolved by
current subgraph or by moving to other subgraphs.
- [ ] `SATISFIABILITY_ERROR` - @provides?
- [ ] more accurate key fields comparison (I did string ≠ string but we need to make it better)
- [ ] support `@interfaceObject`
- [ ] support `[String!]!` and `[String!]` comparison, not only `String!` vs `String`
9 changes: 0 additions & 9 deletions __tests__/composition.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ expect.addSnapshotSerializer({
});

testImplementations(api => {
const library = api.library;
const composeServices = api.composeServices;

function logSupergraph(result: { supergraphSdl: string }) {
console.log('--', library, '--');
console.log(result.supergraphSdl);
}

test('duplicated Query fields', () => {
const result = composeServices([
{
Expand Down Expand Up @@ -2960,9 +2954,6 @@ testImplementations(api => {

if (satisfiesVersionRange('< v2.3', version)) {
assertCompositionFailure(result);
if (api.library === 'apollo') {
console.log(JSON.stringify(result.errors));
}
expect(result.errors).toContainEqual(
expect.objectContaining({
message: '[a] Cannot import unknown element "@interfaceObject".',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ describe('transformSupergraphToPublicSchema', () => {
const resultSdl = transformSupergraphToPublicSchema(sdl);
expect(print(resultSdl)).toMatchInlineSnapshot(`
"type Query {
foo: String @deprecated(reason: \\"jooo\\")
foo: String @deprecated(reason: "jooo")
}"
`);
});
Expand Down
Loading

0 comments on commit b9390e9

Please sign in to comment.