Search in sources :

Example 11 with GraphQLContext

use of graphql.GraphQLContext in project spring-graphql by spring-projects.

the class DataFetchingEnvironmentArgumentResolverTests method resolveGraphQlContext.

@Test
void resolveGraphQlContext() {
    GraphQLContext context = GraphQLContext.newContext().build();
    DataFetchingEnvironment environment = environment().graphQLContext(context).build();
    Object actual = this.resolver.resolveArgument(parameter(0), environment);
    assertThat(actual).isSameAs(context);
}
Also used : GraphQLContext(graphql.GraphQLContext) DataFetchingEnvironment(graphql.schema.DataFetchingEnvironment) Test(org.junit.jupiter.api.Test)

Aggregations

GraphQLContext (graphql.GraphQLContext)11 Test (org.junit.jupiter.api.Test)6 ExecutionInput (graphql.ExecutionInput)4 Book (org.springframework.graphql.Book)4 DataFetchingEnvironment (graphql.schema.DataFetchingEnvironment)3 Optional (java.util.Optional)3 AtomicReference (java.util.concurrent.atomic.AtomicReference)3 DataLoaderRegistry (org.dataloader.DataLoaderRegistry)3 Flux (reactor.core.publisher.Flux)3 Mono (reactor.core.publisher.Mono)3 GraphQL (graphql.GraphQL)2 DataFetcher (graphql.schema.DataFetcher)2 Map (java.util.Map)2 Function (java.util.function.Function)2 AssertionsForInterfaceTypes.assertThat (org.assertj.core.api.AssertionsForInterfaceTypes.assertThat)2 DataLoader (org.dataloader.DataLoader)2 NoOpStatisticsCollector (org.dataloader.stats.NoOpStatisticsCollector)2 StatisticsCollector (org.dataloader.stats.StatisticsCollector)2 BookSource (org.springframework.graphql.BookSource)2 RequestInput (org.springframework.graphql.RequestInput)2