Skip to content
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

fix #1996: add missing federation directives to index #2004

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@
import org.jboss.jandex.Indexer;

import io.smallrye.graphql.api.Entry;
import io.smallrye.graphql.api.federation.ComposeDirective;
import io.smallrye.graphql.api.federation.Extends;
import io.smallrye.graphql.api.federation.External;
import io.smallrye.graphql.api.federation.Inaccessible;
import io.smallrye.graphql.api.federation.InterfaceObject;
import io.smallrye.graphql.api.federation.Key;
import io.smallrye.graphql.api.federation.Provides;
import io.smallrye.graphql.api.federation.Requires;
import io.smallrye.graphql.api.federation.Shareable;
import io.smallrye.graphql.api.federation.Tag;

/**
* This creates an index from the classpath.
Expand Down Expand Up @@ -81,12 +86,18 @@ private IndexView createCustomIndex() {
indexer.index(convertClassToInputStream(Entry.class));
indexer.index(convertClassToInputStream(Repeatable.class));

// things from the API module
// directives from the API module
indexer.index(convertClassToInputStream(ComposeDirective.class));
indexer.index(convertClassToInputStream(Extends.class));
indexer.index(convertClassToInputStream(External.class));
indexer.index(convertClassToInputStream(Inaccessible.class));
indexer.index(convertClassToInputStream(InterfaceObject.class));
indexer.index(convertClassToInputStream(Key.class));
indexer.index(convertClassToInputStream(Override.class));
indexer.index(convertClassToInputStream(Provides.class));
indexer.index(convertClassToInputStream(Requires.class));
indexer.index(convertClassToInputStream(Shareable.class));
indexer.index(convertClassToInputStream(Tag.class));
} catch (IOException ex) {
throw new RuntimeException(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void queryWithFormattedCalendarReturnTypeAndArgumentTest() {
GraphQLAssured graphQLAssured = new GraphQLAssured(testingURL);
String response = graphQLAssured
.post("{ someFormattedCalendar(calendar: \"2023 04 at 13 hours\") }");
assertThat(response).contains("{\"data\":{\"someFormattedCalendar\":\"01. April 2023 at 01:00 PM\"}}")
assertThat(response).containsIgnoringCase("{\"data\":{\"someFormattedCalendar\":\"01. April 2023 at 01:00 PM\"}}")
.doesNotContain("error");
}

Expand All @@ -62,7 +62,8 @@ public void queryWithFormattedGregorianCalendarReturnTypeAndArgumentTest() {
GraphQLAssured graphQLAssured = new GraphQLAssured(testingURL);
String response = graphQLAssured
.post("{ someFormattedGregorianCalendar(calendar: \"2023 04 at 13 hours\") }");
assertThat(response).contains("{\"data\":{\"someFormattedGregorianCalendar\":\"01. April 2023 at 01:00 PM\"}}")
assertThat(response)
.containsIgnoringCase("{\"data\":{\"someFormattedGregorianCalendar\":\"01. April 2023 at 01:00 PM\"}}")
.doesNotContain("error");
}

Expand Down
Loading