Skip to content

Commit

Permalink
fix smallrye#1996: add missing federation directives to index
Browse files Browse the repository at this point in the history
  • Loading branch information
t1 committed Jan 13, 2024
1 parent 8245943 commit 93f4d71
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
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

0 comments on commit 93f4d71

Please sign in to comment.