Skip to content

Commit e37cb08

Browse files
committed
Skip eager SDL validation on the unresolvable-type wrapper example
With `VALIDATE_GRAPHQL_SCHEMAS=1` (as on CI), the eager SDL validation raised the unresolvable-type error during GraphQL schema generation, before JSON schema generation could exercise the wrapped `FieldReference#resolve` nil return the example exists to cover, leaving that branch uncovered. Tagging the example with `:dont_validate_graphql_schema` (the existing opt-out for intentionally invalid schemas) makes the error surface via the JSON schema path in all environments.
1 parent 6a733f1 commit e37cb08

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • elasticgraph-json_ingestion/spec/unit/elastic_graph/json_ingestion/schema_definition/indexing

elasticgraph-json_ingestion/spec/unit/elastic_graph/json_ingestion/schema_definition/indexing/wrappers_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ module JSONIngestion::SchemaDefinition
4545
})
4646
end
4747

48-
it "raises a clear error (rather than blowing up internally) for a field whose type never resolves" do
48+
# `:dont_validate_graphql_schema` matters here: with `VALIDATE_GRAPHQL_SCHEMAS=1` (as on CI), the
49+
# eager SDL validation would raise this error during GraphQL schema generation, before the JSON
50+
# schema generation path exercises the wrapped `FieldReference#resolve` nil return that this
51+
# example exists to cover.
52+
it "raises a clear error (rather than blowing up internally) for a field whose type never resolves", :dont_validate_graphql_schema do
4953
# When a field references a type that is never defined, the wrapped `FieldReference#resolve`
5054
# returns `nil`. The schema definition machinery relies on that `nil` to detect the unresolvable
5155
# type and surface a helpful error instead of crashing.

0 commit comments

Comments
 (0)