Commit 0b27841f authored by Bob Van Landuyt's avatar Bob Van Landuyt

Eager load the GraphQL schema in specs

Avoid counting on Rails eager loading the GraphQL types, but preload
them before the specs.

This would avoid loading the schema in 2 separate threads
concurrently (1 inside the specs, 1 inside the test-server that will
receive requests). Loading the schema in parallel like that could
cause duplicate definition errors.
parent 9dc41a09
......@@ -197,3 +197,7 @@ module GraphqlHelpers
allow(GitlabSchema).to receive(:max_query_depth).with(any_args).and_return nil
end
end
# This warms our schema, doing this as part of loading the helpers to avoid
# duplicate loading error when Rails tries autoload the types.
GitlabSchema.graphql_definition
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment