From d13a6a6eb26d5461eb99d9e5828877505a12fbf1 Mon Sep 17 00:00:00 2001 From: Adam Petro Date: Mon, 10 Aug 2026 14:05:15 -0400 Subject: [PATCH] Update Rust toolchain to 1.95 Assisted-By: devx/1d181ca2-8339-4866-b827-7ef7bfb0183f --- .github/workflows/rust.yml | 9 ++ Cargo.lock | 5 +- Cargo.toml | 3 +- bluejay-core/Cargo.toml | 1 + .../src/definition/schema_definition.rs | 2 +- bluejay-operation-normalizer/Cargo.toml | 1 + .../benches/normalize.rs | 2 +- bluejay-operation-normalizer/src/lib.rs | 90 +++++++++---------- bluejay-parser/Cargo.toml | 1 + .../definition/explicit_schema_definition.rs | 2 +- bluejay-parser/src/ast/executable/field.rs | 4 +- .../src/ast/executable/fragment_definition.rs | 2 +- .../src/ast/executable/type_condition.rs | 2 +- .../src/ast/executable/variable_definition.rs | 6 +- bluejay-parser/src/ast/tokens.rs | 8 +- .../lexer/logos_lexer/block_string_lexer.rs | 2 +- bluejay-printer/Cargo.toml | 1 + bluejay-schema-comparator/Cargo.toml | 1 + .../src/diff/directive_definition_argument.rs | 16 ++-- bluejay-typegen-codegen/Cargo.toml | 3 +- .../src/input_object_type_definition.rs | 20 ++--- bluejay-typegen-macro/Cargo.toml | 1 + bluejay-typegen/Cargo.toml | 1 + .../fragment_and_operation_name_clash.stderr | 1 + ...face_fragment_spread_invalid_target.stderr | 1 + .../error/invalid_query.stderr | 7 +- ...query_fragment_and_field_selections.stderr | 7 +- ...lid_query_missing_typename_on_union.stderr | 1 + ...pename_not_first_selection_on_union.stderr | 1 + .../error/invalid_schema.stderr | 1 + ...iple_inline_fragments_for_same_type.stderr | 1 + bluejay-validator/Cargo.toml | 1 + bluejay-validator/src/value/input_coercion.rs | 2 +- bluejay-visibility/Cargo.toml | 1 + bluejay-visibility/src/schema_definition.rs | 2 +- rust-toolchain.toml | 2 +- 36 files changed, 116 insertions(+), 95 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3566113b..8d588c21 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,6 +10,15 @@ env: CARGO_TERM_COLOR: always jobs: + msrv: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Install Rust 1.88.0 + run: rustup toolchain install 1.88.0 --profile minimal + - name: Check minimum Rust version + run: cargo +1.88.0 check --workspace --all-targets --all-features + lint: runs-on: ubuntu-latest steps: diff --git a/Cargo.lock b/Cargo.lock index 3614e7d6..7ed0e251 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -163,7 +163,6 @@ dependencies = [ "proc-macro2", "quote", "syn 3.0.2", - "unicode-segmentation", ] [[package]] @@ -1156,9 +1155,9 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-width" diff --git a/Cargo.toml b/Cargo.toml index 76b5ec17..eddcf781 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ resolver = "2" [workspace.package] version = "0.3.1" +rust-version = "1.88" [workspace.lints.clippy] wildcard_imports = "deny" @@ -26,7 +27,7 @@ bluejay-printer = { path = "./bluejay-printer", version = "=0.3.1" } bluejay-schema-comparator = { path = "./bluejay-schema-comparator", version = "=0.3.1" } bluejay-typegen = { path = "./bluejay-typegen", version = "=0.3.1" } bluejay-typegen-codegen = { path = "./bluejay-typegen-codegen", version = "=0.3.1" } -bluejay-typegen-macro = { path = "./bluejay-typegen-macro", version = "=0.3.1" } +bluejay-typegen-macro = { path = "./bluejay-typegen-macro", version = "=0.3.1", default-features = false } bluejay-validator = { path = "./bluejay-validator", version = "=0.3.1" } bluejay-operation-normalizer = { path = "./bluejay-operation-normalizer", version = "=0.3.1" } bluejay-visibility = { path = "./bluejay-visibility", version = "=0.3.1" } diff --git a/bluejay-core/Cargo.toml b/bluejay-core/Cargo.toml index d8c44818..f2470b28 100644 --- a/bluejay-core/Cargo.toml +++ b/bluejay-core/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-core" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-core/src/definition/schema_definition.rs b/bluejay-core/src/definition/schema_definition.rs index aa3887af..03d8e078 100644 --- a/bluejay-core/src/definition/schema_definition.rs +++ b/bluejay-core/src/definition/schema_definition.rs @@ -102,7 +102,7 @@ pub trait SchemaDefinition: fn get_type_definition( &self, name: &str, - ) -> Option>; + ) -> Option>; fn type_definitions(&self) -> Self::TypeDefinitions<'_>; fn get_directive_definition(&self, name: &str) -> Option<&Self::DirectiveDefinition>; fn directive_definitions(&self) -> Self::DirectiveDefinitions<'_>; diff --git a/bluejay-operation-normalizer/Cargo.toml b/bluejay-operation-normalizer/Cargo.toml index 7269e017..bf967a1d 100644 --- a/bluejay-operation-normalizer/Cargo.toml +++ b/bluejay-operation-normalizer/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-operation-normalizer" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-operation-normalizer/benches/normalize.rs b/bluejay-operation-normalizer/benches/normalize.rs index 5a8a2aae..2dbac0b7 100644 --- a/bluejay-operation-normalizer/benches/normalize.rs +++ b/bluejay-operation-normalizer/benches/normalize.rs @@ -1,7 +1,7 @@ use bluejay_parser::ast::{executable::ExecutableDocument, Parse}; use criterion::{criterion_group, criterion_main, Criterion}; -fn parse(input: &str) -> ExecutableDocument { +fn parse(input: &str) -> ExecutableDocument<'_> { ExecutableDocument::parse(input) .result .expect("parse error") diff --git a/bluejay-operation-normalizer/src/lib.rs b/bluejay-operation-normalizer/src/lib.rs index 03b64ba7..87f32cf2 100644 --- a/bluejay-operation-normalizer/src/lib.rs +++ b/bluejay-operation-normalizer/src/lib.rs @@ -22,54 +22,54 @@ //! each selection. This is a single bottom-up pass that builds and normalizes each level //! before returning it to the parent: //! -//! a. **Fields** — collect the field name (dropping any alias), sorted argument names, -//! sorted directives, and recursively normalized child selections. -//! ```graphql -//! # input -//! { myAlias: field(z: 1, a: 2) } -//! # normalized -//! query{field(a:,z:)} -//! ``` +//! - **Fields** — collect the field name (dropping any alias), sorted argument names, +//! sorted directives, and recursively normalized child selections. +//! ```graphql +//! # input +//! { myAlias: field(z: 1, a: 2) } +//! # normalized +//! query{field(a:,z:)} +//! ``` //! -//! b. **Fragment spreads** — expand inline: replace `...FragName` with -//! `... on { }`, merging directives from both the spread -//! and the fragment definition. Unused fragments are naturally excluded. Cycles are -//! detected via a stack of currently-expanding fragment names. -//! ```graphql -//! # input -//! { ...F } -//! fragment F on User { name } -//! # normalized — spread replaced with inline fragment, named fragment dropped -//! query{...on User{name}} -//! ``` +//! - **Fragment spreads** — expand inline: replace `...FragName` with +//! `... on { }`, merging directives from both the spread +//! and the fragment definition. Unused fragments are naturally excluded. Cycles are +//! detected via a stack of currently-expanding fragment names. +//! ```graphql +//! # input +//! { ...F } +//! fragment F on User { name } +//! # normalized — spread replaced with inline fragment, named fragment dropped +//! query{...on User{name}} +//! ``` //! -//! c. **Inline fragments** — if bare (no type condition, no directives), flatten their -//! children directly into the parent selection set. Otherwise, keep as-is. -//! ```graphql -//! # input — bare inline fragment (no type condition, no directives) -//! { ... { name email } } -//! # normalized — children flattened into parent -//! query{email name} -//! ``` +//! - **Inline fragments** — if bare (no type condition, no directives), flatten their +//! children directly into the parent selection set. Otherwise, keep as-is. +//! ```graphql +//! # input — bare inline fragment (no type condition, no directives) +//! { ... { name email } } +//! # normalized — children flattened into parent +//! query{email name} +//! ``` //! -//! d. **Merge inline fragments** — at each level, merge inline fragments that share the -//! same `(type_condition, directives)` pair into a single inline fragment, combining -//! their child selections. -//! ```graphql -//! # input — two inline fragments on same type -//! { ... on User { name } ... on User { email } } -//! # normalized — merged into one -//! query{...on User{email name}} -//! ``` +//! - **Merge inline fragments** — at each level, merge inline fragments that share the +//! same `(type_condition, directives)` pair into a single inline fragment, combining +//! their child selections. +//! ```graphql +//! # input — two inline fragments on same type +//! { ... on User { name } ... on User { email } } +//! # normalized — merged into one +//! query{...on User{email name}} +//! ``` //! -//! e. **Sort selections** — fields first (alphabetically by field name), then inline -//! fragments (by type condition, then by directives). -//! ```graphql -//! # input -//! { z a ... on User { b } m } -//! # normalized — fields sorted first, then inline fragments -//! query{a m z ...on User{b}} -//! ``` +//! - **Sort selections** — fields first (alphabetically by field name), then inline +//! fragments (by type condition, then by directives). +//! ```graphql +//! # input +//! { z a ... on User { b } m } +//! # normalized — fields sorted first, then inline fragments +//! query{a m z ...on User{b}} +//! ``` //! //! 3. **Serialize** the normalized IR to a compact canonical string: //! - Operation type keyword (`query`, `mutation`, `subscription`) with no name. @@ -147,7 +147,7 @@ mod tests { use super::*; use bluejay_parser::ast::{executable::ExecutableDocument as ParserDoc, Parse}; - fn parse(input: &str) -> ParserDoc { + fn parse(input: &str) -> ParserDoc<'_> { ParserDoc::parse(input).result.expect("parse error") } diff --git a/bluejay-parser/Cargo.toml b/bluejay-parser/Cargo.toml index 81a086b6..43030f1c 100644 --- a/bluejay-parser/Cargo.toml +++ b/bluejay-parser/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-parser" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-parser/src/ast/definition/explicit_schema_definition.rs b/bluejay-parser/src/ast/definition/explicit_schema_definition.rs index 3a2fc618..5f6e3868 100644 --- a/bluejay-parser/src/ast/definition/explicit_schema_definition.rs +++ b/bluejay-parser/src/ast/definition/explicit_schema_definition.rs @@ -19,7 +19,7 @@ pub struct ExplicitSchemaDefinition<'a, C: Context> { impl<'a, C: Context> ExplicitSchemaDefinition<'a, C> { pub(crate) const SCHEMA_IDENTIFIER: &'static str = "schema"; - pub(crate) fn description(&self) -> Option<&StringValue> { + pub(crate) fn description(&self) -> Option<&StringValue<'_>> { self.description.as_ref() } diff --git a/bluejay-parser/src/ast/executable/field.rs b/bluejay-parser/src/ast/executable/field.rs index fabb1866..c4ac3537 100644 --- a/bluejay-parser/src/ast/executable/field.rs +++ b/bluejay-parser/src/ast/executable/field.rs @@ -96,11 +96,11 @@ impl<'a> Field<'a> { &self.name } - pub fn arguments(&self) -> Option<&VariableArguments> { + pub fn arguments(&self) -> Option<&VariableArguments<'_>> { self.arguments.as_ref() } - pub fn selection_set(&self) -> Option<&SelectionSet> { + pub fn selection_set(&self) -> Option<&SelectionSet<'_>> { self.selection_set.as_ref() } } diff --git a/bluejay-parser/src/ast/executable/fragment_definition.rs b/bluejay-parser/src/ast/executable/fragment_definition.rs index c9c810d2..8b65feab 100644 --- a/bluejay-parser/src/ast/executable/fragment_definition.rs +++ b/bluejay-parser/src/ast/executable/fragment_definition.rs @@ -63,7 +63,7 @@ impl<'a> FragmentDefinition<'a> { &self.type_condition } - pub fn selection_set(&self) -> &SelectionSet { + pub fn selection_set(&self) -> &SelectionSet<'_> { &self.selection_set } } diff --git a/bluejay-parser/src/ast/executable/type_condition.rs b/bluejay-parser/src/ast/executable/type_condition.rs index 5f808973..3e5200ef 100644 --- a/bluejay-parser/src/ast/executable/type_condition.rs +++ b/bluejay-parser/src/ast/executable/type_condition.rs @@ -25,7 +25,7 @@ impl<'a> IsMatch<'a> for TypeCondition<'a> { impl TypeCondition<'_> { pub(crate) const ON: &'static str = "on"; - pub fn named_type(&self) -> &Name { + pub fn named_type(&self) -> &Name<'_> { &self.named_type } } diff --git a/bluejay-parser/src/ast/executable/variable_definition.rs b/bluejay-parser/src/ast/executable/variable_definition.rs index 96cf2277..684c6316 100644 --- a/bluejay-parser/src/ast/executable/variable_definition.rs +++ b/bluejay-parser/src/ast/executable/variable_definition.rs @@ -42,15 +42,15 @@ impl<'a> FromTokens<'a> for VariableDefinition<'a> { } impl VariableDefinition<'_> { - pub fn variable(&self) -> &Variable { + pub fn variable(&self) -> &Variable<'_> { &self.variable } - pub fn r#type(&self) -> &VariableType { + pub fn r#type(&self) -> &VariableType<'_> { &self.r#type } - pub fn default_value(&self) -> Option<&ConstValue> { + pub fn default_value(&self) -> Option<&ConstValue<'_>> { self.default_value.as_ref() } } diff --git a/bluejay-parser/src/ast/tokens.rs b/bluejay-parser/src/ast/tokens.rs index 8b5064dd..c90e48c9 100644 --- a/bluejay-parser/src/ast/tokens.rs +++ b/bluejay-parser/src/ast/tokens.rs @@ -20,7 +20,7 @@ pub trait Tokens<'a>: Iterator> { fn next_if_name(&mut self) -> Option>; fn next_if_name_matches(&mut self, name: &str) -> Option; fn peek_variable_name(&mut self, n: usize) -> bool; - fn peek_name(&mut self, n: usize) -> Option<&Name>; + fn peek_name(&mut self, n: usize) -> Option<&Name<'_>>; fn peek_name_matches(&mut self, n: usize, name: &str) -> bool; fn peek_string_value(&mut self, n: usize) -> bool; fn peek_punctuator_matches(&mut self, n: usize, punctuator_type: PunctuatorType) -> bool; @@ -56,7 +56,7 @@ impl<'a, T: Lexer<'a>> LexerTokens<'a, T> { } #[inline] - pub fn peek_next(&mut self) -> Option<&LexicalToken> { + pub fn peek_next(&mut self) -> Option<&LexicalToken<'_>> { self.peek(0) } @@ -201,7 +201,7 @@ impl<'a, T: Lexer<'a>> LexerTokens<'a, T> { } #[inline] - pub fn peek_name(&mut self, n: usize) -> Option<&Name> { + pub fn peek_name(&mut self, n: usize) -> Option<&Name<'_>> { self.peek(n).and_then(LexicalToken::as_name) } @@ -304,7 +304,7 @@ impl<'a, T: Lexer<'a>> Tokens<'a> for LexerTokens<'a, T> { } #[inline] - fn peek_name(&mut self, n: usize) -> Option<&Name> { + fn peek_name(&mut self, n: usize) -> Option<&Name<'_>> { self.peek_name(n) } diff --git a/bluejay-parser/src/lexer/logos_lexer/block_string_lexer.rs b/bluejay-parser/src/lexer/logos_lexer/block_string_lexer.rs index 8f7d14ad..17ac1b05 100644 --- a/bluejay-parser/src/lexer/logos_lexer/block_string_lexer.rs +++ b/bluejay-parser/src/lexer/logos_lexer/block_string_lexer.rs @@ -104,7 +104,7 @@ impl Token { let common_indent = lines[1..] .iter() .filter_map(|&(start, end)| { - let line_bytes = raw[start..end].as_bytes(); + let line_bytes = &raw.as_bytes()[start..end]; let indent = line_bytes.iter().position(|&b| b != b' ' && b != b'\t'); indent // None means all-whitespace, filtered out }) diff --git a/bluejay-printer/Cargo.toml b/bluejay-printer/Cargo.toml index afbda4b5..8418c3df 100644 --- a/bluejay-printer/Cargo.toml +++ b/bluejay-printer/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-printer" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-schema-comparator/Cargo.toml b/bluejay-schema-comparator/Cargo.toml index c31dac83..21233f3e 100644 --- a/bluejay-schema-comparator/Cargo.toml +++ b/bluejay-schema-comparator/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-schema-comparator" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-schema-comparator/src/diff/directive_definition_argument.rs b/bluejay-schema-comparator/src/diff/directive_definition_argument.rs index 35786213..4782aa12 100644 --- a/bluejay-schema-comparator/src/diff/directive_definition_argument.rs +++ b/bluejay-schema-comparator/src/diff/directive_definition_argument.rs @@ -49,14 +49,14 @@ impl<'a, S: SchemaDefinition + 'a> DirectiveDefinitionArgumentDiff<'a, S> { self.old_argument_definition.default_value(), self.new_argument_definition.default_value(), ) { - (Some(old_default), Some(new_default)) => { - if old_default.as_ref() != new_default.as_ref() { - changes.push(Change::DirectiveDefinitionArgumentDefaultValueChanged { - directive_definition: self.directive_definition, - old_argument_definition: self.old_argument_definition, - new_argument_definition: self.new_argument_definition, - }); - } + (Some(old_default), Some(new_default)) + if old_default.as_ref() != new_default.as_ref() => + { + changes.push(Change::DirectiveDefinitionArgumentDefaultValueChanged { + directive_definition: self.directive_definition, + old_argument_definition: self.old_argument_definition, + new_argument_definition: self.new_argument_definition, + }); } (Some(_), None) | (None, Some(_)) => { changes.push(Change::DirectiveDefinitionArgumentDefaultValueChanged { diff --git a/bluejay-typegen-codegen/Cargo.toml b/bluejay-typegen-codegen/Cargo.toml index d368d762..378a37f0 100644 --- a/bluejay-typegen-codegen/Cargo.toml +++ b/bluejay-typegen-codegen/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-typegen-codegen" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" @@ -17,8 +18,6 @@ syn = { version = "3.0", features = ["full"] } quote = "1.0" proc-macro2 = "1.0" convert_case = "0.10" -# Pin: v1.13+ requires Rust 1.86+. Remove once toolchain is upgraded. -unicode-segmentation = ">=1.11, <1.13" itertools = "0.15.0" [lints] diff --git a/bluejay-typegen-codegen/src/input_object_type_definition.rs b/bluejay-typegen-codegen/src/input_object_type_definition.rs index 40c12cfb..7d458ec9 100644 --- a/bluejay-typegen-codegen/src/input_object_type_definition.rs +++ b/bluejay-typegen-codegen/src/input_object_type_definition.rs @@ -184,18 +184,14 @@ impl<'a, S: SchemaDefinition, C: CodeGenerator> InputObjectTypeDefinitionBuilder match ty { InputTypeReference::Base(base, _) if base.name() == target => true, ty => match ty.base(self.config.schema_definition()) { - BaseInputTypeReference::InputObject(iotd) => { - if visited.insert(iotd.name()) { - iotd.input_field_definitions().iter().any(|ivd| { - self.contains_non_list_reference( - target, - ivd.r#type().as_ref(self.config.schema_definition()), - visited, - ) - }) - } else { - false - } + BaseInputTypeReference::InputObject(iotd) if visited.insert(iotd.name()) => { + iotd.input_field_definitions().iter().any(|ivd| { + self.contains_non_list_reference( + target, + ivd.r#type().as_ref(self.config.schema_definition()), + visited, + ) + }) } _ => false, }, diff --git a/bluejay-typegen-macro/Cargo.toml b/bluejay-typegen-macro/Cargo.toml index 6d86b60c..b0cf9f7a 100644 --- a/bluejay-typegen-macro/Cargo.toml +++ b/bluejay-typegen-macro/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-typegen-macro" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-typegen/Cargo.toml b/bluejay-typegen/Cargo.toml index ef35c651..38687e67 100644 --- a/bluejay-typegen/Cargo.toml +++ b/bluejay-typegen/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-typegen" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-typegen/tests/validation_cases/error/fragment_and_operation_name_clash.stderr b/bluejay-typegen/tests/validation_cases/error/fragment_and_operation_name_clash.stderr index 3b11d125..ba5b1e75 100644 --- a/bluejay-typegen/tests/validation_cases/error/fragment_and_operation_name_clash.stderr +++ b/bluejay-typegen/tests/validation_cases/error/fragment_and_operation_name_clash.stderr @@ -7,6 +7,7 @@ error: Error: typegen requires fragment and operation names to be unique, but en │ │ │ ╰───────────────── Fragment definition name collides with operation definition name ───╯ + --> tests/validation_cases/error/fragment_and_operation_name_clash.rs:11:13 | 11 | #[query([ diff --git a/bluejay-typegen/tests/validation_cases/error/interface_fragment_spread_invalid_target.stderr b/bluejay-typegen/tests/validation_cases/error/interface_fragment_spread_invalid_target.stderr index aec23c53..b0ee715f 100644 --- a/bluejay-typegen/tests/validation_cases/error/interface_fragment_spread_invalid_target.stderr +++ b/bluejay-typegen/tests/validation_cases/error/interface_fragment_spread_invalid_target.stderr @@ -5,6 +5,7 @@ error: Error: typegen requires fragment spreads on interfaces to target either t │ ──────┬────── │ ╰──────── Fragment spread on interface type ───╯ + --> tests/validation_cases/error/interface_fragment_spread_invalid_target.rs:15:13 | 15 | #[query([ diff --git a/bluejay-typegen/tests/validation_cases/error/invalid_query.stderr b/bluejay-typegen/tests/validation_cases/error/invalid_query.stderr index bd572e06..2a23b315 100644 --- a/bluejay-typegen/tests/validation_cases/error/invalid_query.stderr +++ b/bluejay-typegen/tests/validation_cases/error/invalid_query.stderr @@ -5,12 +5,13 @@ error: Error: Field `bar` does not exist on type `Query` │ ─┬─ │ ╰─── Field does not exist on type `Query` ───╯ + --> tests/validation_cases/error/invalid_query.rs:7:13 | -7 | #[query([ + 7 | #[query([ | _____________^ -8 | | { -9 | | bar + 8 | | { + 9 | | bar 10 | | } 11 | | ])] | |_____^ diff --git a/bluejay-typegen/tests/validation_cases/error/invalid_query_fragment_and_field_selections.stderr b/bluejay-typegen/tests/validation_cases/error/invalid_query_fragment_and_field_selections.stderr index 8ddc528f..a93f8f6a 100644 --- a/bluejay-typegen/tests/validation_cases/error/invalid_query_fragment_and_field_selections.stderr +++ b/bluejay-typegen/tests/validation_cases/error/invalid_query_fragment_and_field_selections.stderr @@ -7,12 +7,13 @@ error: Error: typegen requires a fragment spread to be the only selection in the │ │ │ ╰────────── Fragment spread ───╯ + --> tests/validation_cases/error/invalid_query_fragment_and_field_selections.rs:7:13 | -7 | #[query([ + 7 | #[query([ | _____________^ -8 | | { -9 | | foo + 8 | | { + 9 | | foo 10 | | ...MyFragment ... | 16 | | ])] diff --git a/bluejay-typegen/tests/validation_cases/error/invalid_query_missing_typename_on_union.stderr b/bluejay-typegen/tests/validation_cases/error/invalid_query_missing_typename_on_union.stderr index 175fbe73..07266069 100644 --- a/bluejay-typegen/tests/validation_cases/error/invalid_query_missing_typename_on_union.stderr +++ b/bluejay-typegen/tests/validation_cases/error/invalid_query_missing_typename_on_union.stderr @@ -5,6 +5,7 @@ error: Error: typegen requires unaliased selection of `__typename` on union type │ ───────────────────┬─────────────────── │ ╰───────────────────── Selection set does not contain an unaliased `__typename` selection as the first selection ───╯ + --> tests/validation_cases/error/invalid_query_missing_typename_on_union.rs:17:13 | 17 | #[query([ diff --git a/bluejay-typegen/tests/validation_cases/error/invalid_query_typename_not_first_selection_on_union.stderr b/bluejay-typegen/tests/validation_cases/error/invalid_query_typename_not_first_selection_on_union.stderr index ca97dd76..f73c82c5 100644 --- a/bluejay-typegen/tests/validation_cases/error/invalid_query_typename_not_first_selection_on_union.stderr +++ b/bluejay-typegen/tests/validation_cases/error/invalid_query_typename_not_first_selection_on_union.stderr @@ -13,6 +13,7 @@ error: Error: typegen requires unaliased selection of `__typename` on union type │ ─────┬──── │ ╰────── Field selection on union type ───╯ + --> tests/validation_cases/error/invalid_query_typename_not_first_selection_on_union.rs:17:13 | 17 | #[query([ diff --git a/bluejay-typegen/tests/validation_cases/error/invalid_schema.stderr b/bluejay-typegen/tests/validation_cases/error/invalid_schema.stderr index 42f6bfd8..8ee09bb8 100644 --- a/bluejay-typegen/tests/validation_cases/error/invalid_schema.stderr +++ b/bluejay-typegen/tests/validation_cases/error/invalid_schema.stderr @@ -5,6 +5,7 @@ error: Error: Referenced type `Bar` does not exist │ ─┬─ │ ╰─── No definition for referenced type ───╯ + --> tests/validation_cases/error/invalid_schema.rs:1:28 | 1 | #[bluejay_typegen::typegen([ diff --git a/bluejay-typegen/tests/validation_cases/error/union_multiple_inline_fragments_for_same_type.stderr b/bluejay-typegen/tests/validation_cases/error/union_multiple_inline_fragments_for_same_type.stderr index 11205624..f2a12f56 100644 --- a/bluejay-typegen/tests/validation_cases/error/union_multiple_inline_fragments_for_same_type.stderr +++ b/bluejay-typegen/tests/validation_cases/error/union_multiple_inline_fragments_for_same_type.stderr @@ -9,6 +9,7 @@ error: Error: typegen requires the inline fragments in a selection set have uniq │ │ │ ╰──────────── Inline fragment targeting Bar ───╯ + --> tests/validation_cases/error/union_multiple_inline_fragments_for_same_type.rs:17:13 | 17 | #[query([ diff --git a/bluejay-validator/Cargo.toml b/bluejay-validator/Cargo.toml index 28dfd98b..e99f2609 100644 --- a/bluejay-validator/Cargo.toml +++ b/bluejay-validator/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-validator" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-validator/src/value/input_coercion.rs b/bluejay-validator/src/value/input_coercion.rs index ae657b98..db9946dc 100644 --- a/bluejay-validator/src/value/input_coercion.rs +++ b/bluejay-validator/src/value/input_coercion.rs @@ -282,7 +282,7 @@ fn coerce_input_object_value< errors.extend( indexed_object .iter() - .filter(|(_, entries)| (entries.len() > 1)) + .filter(|(_, entries)| entries.len() > 1) .map(|(&field_name, entries)| Error::NonUniqueFieldNames { value, field_name, diff --git a/bluejay-visibility/Cargo.toml b/bluejay-visibility/Cargo.toml index 6accb785..5686c45b 100644 --- a/bluejay-visibility/Cargo.toml +++ b/bluejay-visibility/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bluejay-visibility" version.workspace = true +rust-version.workspace = true edition = "2021" license = "MIT" repository = "https://github.com/Shopify/bluejay" diff --git a/bluejay-visibility/src/schema_definition.rs b/bluejay-visibility/src/schema_definition.rs index a02db85a..b5c1be03 100644 --- a/bluejay-visibility/src/schema_definition.rs +++ b/bluejay-visibility/src/schema_definition.rs @@ -201,7 +201,7 @@ impl<'a, S: definition::SchemaDefinition + 'a, W: Warden> fn get_type_definition( &self, name: &str, - ) -> Option> { + ) -> Option> { self.cache .get_type_definition(name) .or_else(|| { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a950606f..cb5b89d3 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.85.1" +channel = "1.95.0" targets = ["wasm32-wasip1"]