Skip to content

Commit

Permalink
graph: Fix suppression of _Schema_ type
Browse files Browse the repository at this point in the history
Commit e76ad68 caused fulltext search fields to not show up in the Query
type
  • Loading branch information
lutter committed Feb 15, 2024
1 parent e76ad68 commit b1bf41c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions graph/src/schema/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ fn add_query_type(api: &mut s::Document, input_schema: &InputSchema) -> Result<(
.map(|(name, _)| name)
.flat_map(query_fields_for_agg_type)
.collect::<Vec<s::Field>>();
let mut fulltext_fields = api
let mut fulltext_fields = input_schema
.get_fulltext_directives()
.map_err(|_| APISchemaError::FulltextSearchNonDeterministic)?
.iter()
Expand Down Expand Up @@ -1311,7 +1311,7 @@ mod tests {
subgraph::LATEST_VERSION,
},
prelude::{s, DeploymentHash},
schema::InputSchema,
schema::{InputSchema, SCHEMA_TYPE_NAME},
};
use graphql_parser::schema::*;
use lazy_static::lazy_static;
Expand Down Expand Up @@ -2131,6 +2131,9 @@ type Gravatar @entity {
"#;
let schema = parse(SCHEMA);

// The _Schema_ type must not be copied to the API schema as it will
// cause GraphQL validation failures on clients
assert_eq!(None, schema.get_named_type(SCHEMA_TYPE_NAME));
let query_type = schema
.get_named_type("Query")
.expect("Query type is missing in derived API schema");
Expand Down

0 comments on commit b1bf41c

Please sign in to comment.