Skip to content

Commit 97a4cc8

Browse files
committed
General spelling improvements to the code
As prompted by a trade-off made in #7210 (comment)
1 parent 02e59bf commit 97a4cc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+86
-85
lines changed

.config/mise/config.toml

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ rust = "1.85.0"
1212
"cargo:graphql_client_cli" = "0.14.0"
1313
"cargo:cargo-llvm-cov" = "0.6.10"
1414
"cargo:cargo-fuzz" = "0.12.0"
15+
"cargo:typos-cli" = "1.31.1"

DEVELOPMENT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ cargo build --profile release-dhat --features dhat-heap
106106

107107
This will create a router in `./target/release-dhat`, which can be run with:
108108
```shell
109-
cargo run --profile release-dhat --feautures dhat-heap -- -s ./apollo-router/testing_schema.graphql -c router.yaml
109+
cargo run --profile release-dhat --features dhat-heap -- -s ./apollo-router/testing_schema.graphql -c router.yaml
110110
```
111111

112112
When you run your binary, on termination you will get `dhat-heap.json` and/or `dhat-ad-hoc.json` files which can

RELEASE_CHECKLIST.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Start following the steps below to start a release PR. The process is **not ful
283283
git push --set-upstream "${APOLLO_ROUTER_RELEASE_GIT_ORIGIN}" "prep-${APOLLO_ROUTER_RELEASE_VERSION}"
284284
```
285285
286-
15. Programatically create a small temporary file called `this_release.md` with the changelog details of _precisely this release_ from the `CHANGELOG.md`:
286+
15. Programmatically create a small temporary file called `this_release.md` with the changelog details of _precisely this release_ from the `CHANGELOG.md`:
287287
288288
> Note: This file could totally be created by the `xtask` if we merely decide convention for it and whether we want it checked in or not. It will be used again later in process and, in theory, by CI. Definitely not suggesting this should live on as regex.
289289

apollo-federation/src/link/link_spec_definition.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl LinkSpecDefinition {
156156
// (in practice, our own code can actually handle this as it does not strongly rely on
157157
// that "it should be the first" rule, but that would set a bad example).
158158
// 2. earlier versions (pre-#1875) were always putting that directive on the definition,
159-
// and we wanted to avoid suprising users by changing that for not reason.
159+
// and we wanted to avoid surprising users by changing that for not reason.
160160
//
161161
// So instead, we put the directive on the schema definition unless some extensions exists
162162
// but no definition does (that is, no non-extension elements are populated).

apollo-federation/src/operation/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static NEXT_ID: atomic::AtomicUsize = atomic::AtomicUsize::new(1);
7777
///
7878
/// NOTE: This ID does not ensure that IDs are unique because its internal counter resets on
7979
/// startup. It currently implements `Serialize` for debugging purposes. It should not implement
80-
/// `Deserialize`, and, more specfically, it should not be used for caching until uniqueness is
80+
/// `Deserialize`, and, more specifically, it should not be used for caching until uniqueness is
8181
/// provided (i.e. the inner type is a `Uuid` or the like).
8282
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, serde::Serialize)]
8383
pub(crate) struct SelectionId(usize);
@@ -1324,7 +1324,7 @@ impl SelectionSet {
13241324
/// so we can efficiently generate query plans. In order to prevent the query planner from spending time
13251325
/// exploring those useless __typename options, we "remove" the unnecessary __typename selections from the
13261326
/// operation. Since we need to ensure that the __typename field will still need to be queried, we "tag"
1327-
/// one of the "sibling" selections (using "attachement") to remember that __typename needs to be added
1327+
/// one of the "sibling" selections (using "attachment") to remember that __typename needs to be added
13281328
/// back eventually. The core query planning algorithm will ignore that tag, and because __typename has been
13291329
/// otherwise removed, we'll save any related work. As we build the final query plan, we'll check back for
13301330
/// those "tags" and add back the __typename selections. As this only happen after the query planning
@@ -1698,7 +1698,7 @@ impl SelectionSet {
16981698
///
16991699
/// The final selections are optional. If `path` ends on a leaf field, then no followup
17001700
/// selections would make sense.
1701-
/// When final selections are provided, unecessary fragments will be automatically removed
1701+
/// When final selections are provided, unnecessary fragments will be automatically removed
17021702
/// at the junction between the path and those final selections.
17031703
///
17041704
/// For instance, suppose that we have:
@@ -2144,12 +2144,12 @@ fn compute_aliases_for_non_merging_fields(
21442144
};
21452145
}
21462146
} else {
2147-
// We need to alias the new occurence.
2147+
// We need to alias the new occurrence.
21482148
let alias = gen_alias_name(response_name, &seen_response_names);
21492149

21502150
// Given how we generate aliases, it's is very unlikely that the generated alias will conflict with any of the other response name
21512151
// at the level, but it's theoretically possible. By adding the alias to the seen names, we ensure that in the remote change that
2152-
// this ever happen, we'll avoid the conflict by giving another alias to the followup occurence.
2152+
// this ever happen, we'll avoid the conflict by giving another alias to the followup occurrence.
21532153
let selections = match field.selection_set.as_ref() {
21542154
Some(s) => {
21552155
let mut p = path.clone();

apollo-federation/src/query_graph/graph_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ pub(crate) struct SubgraphEnteringEdgeInfo {
257257
///
258258
/// NOTE: This ID does not ensure that IDs are unique because its internal counter resets on
259259
/// startup. It currently implements `Serialize` for debugging purposes. It should not implement
260-
/// `Deserialize`, and, more specfically, it should not be used for caching until uniqueness is
260+
/// `Deserialize`, and, more specifically, it should not be used for caching until uniqueness is
261261
/// provided (i.e. the inner type is a `Uuid` or the like).
262262
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, serde::Serialize)]
263263
pub(crate) struct OverrideId(usize);

apollo-federation/src/query_plan/fetch_dependency_graph.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ impl FetchDependencyGraph {
822822
// 1. is for the same subgraph
823823
// 2. has the same merge_at
824824
// 3. is for the same entity type (we don't reuse nodes for different entities just yet,
825-
// as this can create unecessary dependencies that gets in the way of some optimizations;
825+
// as this can create unnecessary dependencies that gets in the way of some optimizations;
826826
// the final optimizations in `reduceAndOptimize` will however later merge nodes
827827
// on the same subgraph and mergeAt when possible).
828828
// 4. is not part of our conditions or our conditions ancestors
@@ -940,7 +940,7 @@ impl FetchDependencyGraph {
940940
return true;
941941
}
942942

943-
// No risk of inifite loop as the graph is acyclic:
943+
// No risk of infinite loop as the graph is acyclic:
944944
let mut to_check = haystack.clone();
945945
while let Some(next) = to_check.pop() {
946946
for parent in self.parents_of(next) {
@@ -3851,7 +3851,7 @@ fn compute_nodes_for_op_path_element<'a>(
38513851
// If the operation contains other directives or a non-trivial type condition,
38523852
// we need to preserve it and so we add operation.
38533853
// Otherwise, we just skip it as a minor optimization (it makes the subgraph query
3854-
// slighly smaller and on complex queries, it might also deduplicate similar selections).
3854+
// slightly smaller and on complex queries, it might also deduplicate similar selections).
38553855
return Ok(ComputeNodesStackItem {
38563856
tree: &child.tree,
38573857
node_id: stack_item.node_id,

apollo-federation/src/query_plan/fetch_dependency_graph_processor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl FetchDependencyGraphProcessor<Option<PlanNode>, DeferredDeferBlock>
302302
// Note that currently `ConditionNode` only works for variables
303303
// (`ConditionNode.condition` is expected to be a variable name and nothing else).
304304
// We could change that, but really, why have a trivial `ConditionNode`
305-
// when we can optimise things righ away.
305+
// when we can optimise things right away.
306306
condition.then_some(value)
307307
}
308308
Conditions::Variables(variables) => {

apollo-federation/src/query_plan/generate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ where
125125
// all plans are guaranteed to be more costly than `initial` anyway.
126126
// Note that save for `initial`,
127127
// we always compute `partialCost` as the pros of exiting some branches early are large enough
128-
// that it outweight computing some costs unecessarily from time to time.
128+
// that it outweigh computing some costs unnecessarily from time to time.
129129
let mut stack = VecDeque::new();
130130
stack.push_back(Partial {
131131
partial_plan: initial,

apollo-federation/src/query_plan/query_planner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ fn compute_root_serial_dependency_graph(
630630
// PORT_NOTE: It is unclear if they correct thing to do here is get the next ID, use
631631
// the current ID that is inside the fetch dep graph's ID generator, or to use the
632632
// starting ID. Because this method ensure uniqueness between IDs, this approach was
633-
// taken; however, it could be the case that this causes unforseen issues.
633+
// taken; however, it could be the case that this causes unforeseen issues.
634634
digest.push(std::mem::replace(
635635
&mut fetch_dependency_graph,
636636
new_dep_graph,

apollo-federation/src/query_plan/query_planning_traversal.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ impl<'a: 'b, 'b> QueryPlanningTraversal<'a, 'b> {
640640
// To guarantee that the selection is fully local from the provided vertex/type, we must have:
641641
// - no edge crossing subgraphs from that vertex.
642642
// - the type must be compositeType (mostly just ensuring the selection make sense).
643-
// - everything in the selection must be avaiable in the type (which `rebaseOn` essentially validates).
643+
// - everything in the selection must be available in the type (which `rebaseOn` essentially validates).
644644
// - the selection must not "type-cast" into any abstract type that has inconsistent runtimes acrosse subgraphs. The reason for the
645645
// later condition is that `selection` is originally a supergraph selection, but that we're looking to apply "as-is" to a subgraph.
646646
// But suppose it has a `... on I` where `I` is an interface. Then it's possible that `I` includes "more" types in the supergraph
@@ -913,11 +913,11 @@ impl<'a: 'b, 'b> QueryPlanningTraversal<'a, 'b> {
913913
}
914914

915915
/// Look at how many plans we'd have to generate and if it's "too much"
916-
/// reduce it to something manageable by arbitrarilly throwing out options.
916+
/// reduce it to something manageable by arbitrarily throwing out options.
917917
/// This effectively means that when a query has too many options,
918918
/// we give up on always finding the "best" query plan in favor of an "ok" query plan.
919919
///
920-
/// TODO: currently, when we need to reduce options, we do so somewhat arbitrarilly.
920+
/// TODO: currently, when we need to reduce options, we do so somewhat arbitrarily.
921921
/// More precisely, we reduce the branches with the most options first
922922
/// and then drop the last option of the branch,
923923
/// repeating until we have a reasonable number of plans to consider.
@@ -1338,7 +1338,7 @@ fn test_prune_and_reorder_first_branch() {
13381338
assert_eq!(branches, expected)
13391339
}
13401340
// Either the first branch had strictly more options than the second,
1341-
// so it is still at its correct potition after removing one option…
1341+
// so it is still at its correct position after removing one option…
13421342
assert(
13431343
&["abcdE", "fgh", "ijk", "lmn", "op"],
13441344
&["abcd", "fgh", "ijk", "lmn", "op"],

apollo-federation/src/query_plan/serializable_document.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use serde::Serialize;
1111
///
1212
/// The relevant schema is required to parse from string but not available during deserialization,
1313
/// so this contains a dual (either or both) “string” or “parsed” representation.
14-
/// Accessing the latter is fallible, and requires an explicit initilization step to provide the schema.
14+
/// Accessing the latter is fallible, and requires an explicit initialization step to provide the schema.
1515
#[derive(Clone)]
1616
pub struct SerializableDocument {
1717
serialized: String,

apollo-federation/src/schema/argument_composition_strategies.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl ArgumentComposition for MaxArgumentCompositionStrategy {
140140
self.validator.is_type_supported(schema, ty)
141141
}
142142

143-
// TODO: check if this neeeds to be an Result<Value> to avoid the panic!()
143+
// TODO: check if this needs to be an Result<Value> to avoid the panic!()
144144
// https://apollographql.atlassian.net/browse/FED-170
145145
fn merge_values(&self, values: &[Value]) -> Value {
146146
values
@@ -180,7 +180,7 @@ impl ArgumentComposition for MinArgumentCompositionStrategy {
180180
self.validator.is_type_supported(schema, ty)
181181
}
182182

183-
// TODO: check if this neeeds to be an Result<Value> to avoid the panic!()
183+
// TODO: check if this needs to be an Result<Value> to avoid the panic!()
184184
// https://apollographql.atlassian.net/browse/FED-170
185185
fn merge_values(&self, values: &[Value]) -> Value {
186186
values
@@ -220,7 +220,7 @@ impl ArgumentComposition for SumArgumentCompositionStrategy {
220220
self.validator.is_type_supported(schema, ty)
221221
}
222222

223-
// TODO: check if this neeeds to be an Result<Value> to avoid the panic!()
223+
// TODO: check if this needs to be an Result<Value> to avoid the panic!()
224224
// https://apollographql.atlassian.net/browse/FED-170
225225
fn merge_values(&self, values: &[Value]) -> Value {
226226
values
@@ -247,7 +247,7 @@ impl ArgumentComposition for IntersectionArgumentCompositionStrategy {
247247
support_any_non_null_array(ty)
248248
}
249249

250-
// TODO: check if this neeeds to be an Result<Value> to avoid the panic!()
250+
// TODO: check if this needs to be an Result<Value> to avoid the panic!()
251251
// https://apollographql.atlassian.net/browse/FED-170
252252
fn merge_values(&self, values: &[Value]) -> Value {
253253
// Each item in `values` must be a Value::List(...).
@@ -280,7 +280,7 @@ impl ArgumentComposition for UnionArgumentCompositionStrategy {
280280
support_any_non_null_array(ty)
281281
}
282282

283-
// TODO: check if this neeeds to be an Result<Value> to avoid the panic!()
283+
// TODO: check if this needs to be an Result<Value> to avoid the panic!()
284284
// https://apollographql.atlassian.net/browse/FED-170
285285
fn merge_values(&self, values: &[Value]) -> Value {
286286
// Each item in `values` must be a Value::List(...).

apollo-federation/src/schema/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ impl ValidFederationSchema {
675675
) -> Result<Name, FederationError> {
676676
// Currently, the types used to define the federation operations, that is _Any, _Entity and _Service,
677677
// are not considered part of the federation spec, and are instead hardcoded to the names above.
678-
// The reason being that there is no way to maintain backward compatbility with fed2 if we were to add
678+
// The reason being that there is no way to maintain backward compatibility with fed2 if we were to add
679679
// those to the federation spec without requiring users to add those types to their @link `import`,
680680
// and that wouldn't be a good user experience (because most users don't really know what those types
681681
// are/do). And so we special case it.

apollo-federation/src/schema/subgraph_metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl SubgraphMetadata {
181181
federation_spec_definition: &'static FederationSpecDefinition,
182182
) -> Result<IndexSet<FieldDefinitionPosition>, FederationError> {
183183
let mut shareable_fields = IndexSet::default();
184-
// @shareable is only avalaible on fed2 schemas, but the schema upgrader call this on fed1 schemas as a shortcut to
184+
// @shareable is only available on fed2 schemas, but the schema upgrader call this on fed1 schemas as a shortcut to
185185
// identify key fields (because if we know nothing is marked @shareable, then the only fields that are shareable
186186
// by default are key fields).
187187
let Some(shareable_directive_name) =

apollo-federation/src/sources/connect/expand/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub enum ExpansionResult {
4848
/// with standard query planning concepts while still enforcing connector-specific rules. To do so,
4949
/// each connector is separated into its own unique subgraph with relevant GraphQL directives to enforce
5050
/// field dependencies and response structures. This allows for satisfiability and validation to piggy-back
51-
/// off of existing functionality in a reproducable way.
51+
/// off of existing functionality in a reproducible way.
5252
pub fn expand_connectors(
5353
supergraph_str: &str,
5454
api_schema_options: &ApiSchemaOptions,

apollo-federation/src/sources/connect/json_selection/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ improvements, we should adhere to the following principles:
4848
2. It must be possible to statically determine the output shape (object
4949
properties, array types, and nested value shapes) produced by a
5050
`JSONSelection` string. JSON data encountered at runtime may be inherently
51-
dynamic and unpredicatable, but we must be able to validate the output shape
51+
dynamic and unpredictable, but we must be able to validate the output shape
5252
matches the GraphQL schema. Because we can assume all input data is some kind
5353
of JSON, for types whose shape cannot be statically determined, the GraphQL
5454
`JSON` scalar type can be used as an "any" type, though this should be

apollo-federation/src/sources/connect/json_selection/location.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub(crate) mod strip_ranges {
157157
use super::WithRange;
158158

159159
/// Including location information in the AST introduces unnecessary
160-
/// varation in many tests. StripLoc is a test-only trait allowing
160+
/// variation in many tests. StripLoc is a test-only trait allowing
161161
/// participating AST nodes to remove their own and their descendants'
162162
/// location information, thereby normalizing the AST for assert_eq!
163163
/// comparisons.

apollo-federation/src/subgraph/spec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl FederationSpecDefinitions {
436436
}
437437
}
438438

439-
// The directive is named `@fromContex`. This is confusing for clippy, as
439+
// The directive is named `@fromContext`. This is confusing for clippy, as
440440
// `from` is a conventional prefix used in conversion methods, which do not
441441
// take `self` as an argument. This function does **not** perform
442442
// conversion, but extracts `@fromContext` directive definition.

apollo-federation/src/supergraph/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2455,7 +2455,7 @@ mod tests {
24552455
d: String
24562456
}
24572457
2458-
* This tests is similar to the other test with unions, but because its members are enties, the
2458+
* This tests is similar to the other test with unions, but because its members are entries, the
24592459
* members themself with have a join__owner, and that means the removal will hit a different
24602460
* code path (technically, the union A will be "removed" directly by `extractSubgraphsFromSupergraph`
24612461
* instead of being removed indirectly through the removal of its members).

0 commit comments

Comments
 (0)