-
Notifications
You must be signed in to change notification settings - Fork 42
define spec for graphql union #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Tim Middleton (Software Engineer) <tim.middleton@oracle.com>
…ddleton@oracle.com>
DefaultValue TCK test has incorrect default CAPE payload
Signed-off-by: Yannick Bröker <ybroeker@techfak.uni-bielefeld.de>
Signed-off-by: Yannick Bröker <ybroeker@techfak.uni-bielefeld.de>
Signed-off-by:Phillip Kruger <phillip.kruger@gmail.com>
Signed-off-by:Phillip Kruger <phillip.kruger@gmail.com>
Add ´ as an escape-character for scheme-tests, closes microprofile#328
Formatting types (master)
…mes String Signed-off-by:Phillip Kruger <phillip.kruger@gmail.com>
Formatter Date becomes String (missed in prev PR)
Signed-off-by: Yannick Bröker <ybroeker@techfak.uni-bielefeld.de>
Signed-off-by: Yannick Bröker <ybroeker@techfak.uni-bielefeld.de>
Signed-off-by: Yannick Bröker <ybroeker@techfak.uni-bielefeld.de>
Signed-off-by: JB <jb.roux@ymail.com>
dynamic client spec draft
Add some testcases
…lues where the order does not matter) Signed-off-by:Phillip Kruger <phillip.kruger@gmail.com>
Added 'AND' condition in Schema Test
Signed-off-by: Jean-Francois James <jefrajames@gmail.com>
Signed-off-by: Jean-Francois James <jefrajames@gmail.com>
Dynamic client specification
Signed-off-by: Jean-Francois James <jefrajames@gmail.com>
….asciidoctor-asciidoctorj-pdf-2.0.3 Bump asciidoctorj-pdf from 1.6.2 to 2.0.3
Bumps [asciidoctorj-diagram](https://github.com/asciidoctor/asciidoctorj-diagram) from 2.2.1 to 2.2.3. - [Release notes](https://github.com/asciidoctor/asciidoctorj-diagram/releases) - [Commits](https://github.com/asciidoctor/asciidoctorj-diagram/commits) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-diagram dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [asciidoctorj-pdf](https://github.com/asciidoctor/asciidoctorj-pdf) from 2.0.3 to 2.0.6. - [Release notes](https://github.com/asciidoctor/asciidoctorj-pdf/releases) - [Commits](asciidoctor/asciidoctorj-pdf@v2.0.3...v2.0.6) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-pdf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
….asciidoctor-asciidoctorj-diagram-2.2.3 Bump asciidoctorj-diagram from 2.2.1 to 2.2.3
….asciidoctor-asciidoctorj-pdf-2.0.6 Bump asciidoctorj-pdf from 2.0.3 to 2.0.6
Bumps [bnd-maven-plugin](https://github.com/bndtools/bnd) from 6.2.0 to 6.3.0. - [Release notes](https://github.com/bndtools/bnd/releases) - [Changelog](https://github.com/bndtools/bnd/blob/master/docs/ADDING_RELEASE_DOCS.md) - [Commits](bndtools/bnd@6.2.0...6.3.0) --- updated-dependencies: - dependency-name: biz.aQute.bnd:bnd-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
….aQute.bnd-bnd-maven-plugin-6.3.0 Bump bnd-maven-plugin from 6.2.0 to 6.3.0
Bumps [bnd-maven-plugin](https://github.com/bndtools/bnd) from 6.3.0 to 6.3.1. - [Release notes](https://github.com/bndtools/bnd/releases) - [Changelog](https://github.com/bndtools/bnd/blob/master/docs/ADDING_RELEASE_DOCS.md) - [Commits](bndtools/bnd@6.3.0...6.3.1) --- updated-dependencies: - dependency-name: biz.aQute.bnd:bnd-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
….aQute.bnd-bnd-maven-plugin-6.3.1 Bump bnd-maven-plugin from 6.3.0 to 6.3.1
Bumps apache-rat-plugin from 0.13 to 0.14. --- updated-dependencies: - dependency-name: org.apache.rat:apache-rat-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
….apache.rat-apache-rat-plugin-0.14 Bump apache-rat-plugin from 0.13 to 0.14
Bumps [asciidoctorj-pdf](https://github.com/asciidoctor/asciidoctorj-pdf) from 2.0.6 to 2.0.8. - [Release notes](https://github.com/asciidoctor/asciidoctorj-pdf/releases) - [Commits](asciidoctor/asciidoctorj-pdf@v2.0.6...v2.0.8) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-pdf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
….asciidoctor-asciidoctorj-pdf-2.0.8 Bump asciidoctorj-pdf from 2.0.6 to 2.0.8
Bumps [asciidoctorj-pdf](https://github.com/asciidoctor/asciidoctorj-pdf) from 2.0.8 to 2.1.2. - [Release notes](https://github.com/asciidoctor/asciidoctorj-pdf/releases) - [Commits](asciidoctor/asciidoctorj-pdf@v2.0.8...v2.1.2) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-pdf dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
….asciidoctor-asciidoctorj-pdf-2.1.2 Bump asciidoctorj-pdf from 2.0.8 to 2.1.2
Bumps [graphql-java](https://github.com/graphql-java/graphql-java) from 18.1 to 18.2. - [Release notes](https://github.com/graphql-java/graphql-java/releases) - [Commits](graphql-java/graphql-java@v18.1...v18.2) --- updated-dependencies: - dependency-name: com.graphql-java:graphql-java dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [asciidoctorj-pdf](https://github.com/asciidoctor/asciidoctorj-pdf) from 2.1.2 to 2.1.4. - [Release notes](https://github.com/asciidoctor/asciidoctorj-pdf/releases) - [Commits](asciidoctor/asciidoctorj-pdf@v2.1.2...v2.1.4) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-pdf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
….graphql-java-graphql-java-18.2 Bump graphql-java from 18.1 to 18.2
….asciidoctor-asciidoctorj-pdf-2.1.4 Bump asciidoctorj-pdf from 2.1.2 to 2.1.4
Bumps [jsonassert](https://github.com/skyscreamer/JSONassert) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/skyscreamer/JSONassert/releases) - [Changelog](https://github.com/skyscreamer/JSONassert/blob/master/CHANGELOG.md) - [Commits](skyscreamer/JSONassert@jsonassert-1.5.0...jsonassert-1.5.1) --- updated-dependencies: - dependency-name: org.skyscreamer:jsonassert dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
….skyscreamer-jsonassert-1.5.1 Bump jsonassert from 1.5.0 to 1.5.1
Hi @craig-day - thanks for this. We typically do things in an implementation first, to give it some bake time, before we move it to the spec. Maybe we should attempt this in smallrye graphql first? |
@phillip-kruger thanks for the reply. I'm working on this implementation in smallrye too! I'll cross-link a PR here once I get that worked through. |
@craig-day - Great. You can move all this (api) stuff to SmallRye until it's ready to move up to the spec. (see https://github.com/smallrye/smallrye-graphql/tree/main/server/api) |
@phillip-kruger smallrye impl PR here: smallrye/smallrye-graphql#1469 |
@craig-day Thanks. Let discuss it in SmallRye, get it merged there and into a runtime, to get some bake time, before we get back here. Maybe convert this to a draft ? |
I took a stab at defining and adding examples for union types. As unions are very similar to interfaces, I based it heavily on the interface setup. I chose to also leverage a java interface as the union itself, because an interface with no defined fields/methods represents the concept of a union well.
Another approach to this could be to not have a "base class", i.e. interface, at all. Instead, the
@Union
annotation could require thevalue
and then any types annotated with the same union name would become members of that union. For example:would create
Additional Considerations
Mixing polymorphism in GraphQL is not very nice. In the case of unions, a member can only be a
type
. This means if you want an interface to be a part of a union, you must instead add each concrete implementation of the interface to the union. However, you can then query the union with fragments as if it were an interface.Should the spec explicitly define what should happen in this scenario? If someone structures code where a union would contain members that are interfaces, should it be explicitly stated that the implementation must automatically expand the implementations? For example:
should generate
Obviously this example is contrived, but is just to illustrate the scenario. I have a few services with very large schemas (10k+ types) and we have plenty of situations where a union contains one or more interfaces.