Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/graphql/analysis/QueryTraverser.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void visitField(QueryVisitorFieldEnvironment env) {
* @param initialValue the initial value to pass to the reducer
* @param <T> the type of reduced value
*
* @return the calucalated overall value
* @return the calculated overall value
*/
@SuppressWarnings("unchecked")
public <T> T reducePreOrder(QueryReducer<T> queryReducer, T initialValue) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/graphql/collect/ImmutableKit.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static <K, V> ImmutableMap<K, V> emptyMap() {
}

/**
* ImmutableMaps are hard to build via {@link Map#computeIfAbsent(Object, Function)} style. This methods
* ImmutableMaps are hard to build via {@link Map#computeIfAbsent(Object, Function)} style. This method
* allows you to take a mutable map with mutable list of keys and make it immutable.
* <p>
* This of course has a cost - if the map is very large you will be using more memory. But for static
Expand Down Expand Up @@ -118,7 +118,7 @@ public static <T> ImmutableList<T> addToList(Collection<? extends T> existing, T
* @param extraValues more values to add
* @param <T> for two
*
* @return an Immutable Set with the extra itens.
* @return an Immutable Set with the extra items.
*/
public static <T> ImmutableSet<T> addToSet(Collection<? extends T> existing, T newValue, T... extraValues) {
assertNotNull(existing);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/graphql/execution/ExecutionStepInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@PublicApi
public class ExecutionStepInfo {

/**
/*
* An ExecutionStepInfo represent either a field or a list element inside a list of objects/interfaces/unions.
*
* A StepInfo never represent a Scalar/Enum inside a list (e.g. [String]) because GraphQL execution doesn't descend down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public FetchedValue getFetchedValue() {
return fetchedValue;
}

public FetchedValueAnalysis transfrom(Consumer<Builder> builderConsumer) {
public FetchedValueAnalysis transform(Consumer<Builder> builderConsumer) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as an internal class we can change this - :)

Copy link
Contributor Author

@dfa1 dfa1 Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes... I'll propose this @internal annotation in my team as well... it is very useful 😊

Builder builder = new Builder(this);
builderConsumer.accept(builder);
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected boolean persistedQueryIdIsInvalid(Object persistedQueryId, String quer
}

/**
* Allows you to customize the graphql error that is sent back on a missing persistend query
* Allows you to customize the graphql error that is sent back on a missing persisted query
*
* @param persistedQueryError the missing persistent query exception
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public IntrospectionWithDirectivesSupport(DirectivePredicate directivePredicate)
* This version allows you to filter what directives are listed via the provided predicate
*
* Some graphql systems (graphql-js in 2021) cannot cope with extra types starting with `__`
* so we use a `_` as a prefx by default. You can supply your own prefix via this constructor.
* so we use a `_` as a prefix by default. You can supply your own prefix via this constructor.
*
* See: https://github.com/graphql-java/graphql-java/pull/2221 for more details
*
Expand Down Expand Up @@ -251,7 +251,7 @@ public interface DirectivePredicateEnvironment {

/**
* A schema has two list of directives. A list of directives that are defined
* in that schema and the list of direcives that are applied to a schema element.
* in that schema and the list of directives that are applied to a schema element.
*
* This returns true if this filtering represents the defined directives.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/graphql/normalized/ENFMerger.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ && isFieldInSharedInterface(field, fieldInGroup, schema)
}

private static boolean isFieldInSharedInterface(ExecutableNormalizedField fieldOne, ExecutableNormalizedField fieldTwo, GraphQLSchema schema) {
/**
/*
* we can get away with only checking one of the object names, because all object names in one ENF are guaranteed to be the same field.
* This comes from how the ENFs are created in the factory before.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/graphql/relay/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface Connection<T> {
List<Edge<T>> getEdges();

/**
* @return {@link graphql.relay.PageInfo} pagination data about about that list of edges
* @return {@link graphql.relay.PageInfo} pagination data about that list of edges
*/
PageInfo getPageInfo();

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/graphql/schema/GraphQLCodeRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public DataFetcher<?> getDataFetcher(FieldCoordinates coordinates, GraphQLFieldD
}

/**
* @return the default data fetcher facttory associated with this code registry
* @return the default data fetcher factory associated with this code registry
*/
public DataFetcherFactory<?> getDefaultDataFetcherFactory() {
return defaultDataFetcherFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/graphql/schema/GraphQLInputObjectField.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public Builder type(GraphQLInputType type) {
}

/**
* A legacy method for setting a defaulr value
* A legacy method for setting a default value
*
* @param defaultValue the value to set
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/graphql/schema/SchemaTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
* <p>
* To insert elements use either {@link GraphQLTypeVisitor#insertAfter(TraverserContext, GraphQLSchemaElement)} or
* {@link GraphQLTypeVisitor#insertBefore(TraverserContext, GraphQLSchemaElement)}
* which will insert the new node before or afgter the current node being visited
* which will insert the new node before or after the current node being visited
* <pre>
* {@code
* public TraversalControl visitGraphQLObjectType(GraphQLObjectType objectType, TraverserContext<GraphQLSchemaElement> context) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/graphql/schema/diff/SchemaDiff.java
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,9 @@ private Optional<OperationTypeDefinition> getOpDef(String opName, SchemaDefiniti

// looks for a type called `Query|Mutation|Subscription` and if it exist then assumes it as an operation def

private Optional<OperationTypeDefinition> synthOperationTypeDefinition(Function<Type, Optional<ObjectTypeDefinition>> typeReteriver, String opName) {
private Optional<OperationTypeDefinition> synthOperationTypeDefinition(Function<Type, Optional<ObjectTypeDefinition>> typeRetriever, String opName) {
TypeName type = TypeName.newTypeName().name(capitalize(opName)).build();
Optional<ObjectTypeDefinition> typeDef = typeReteriver.apply(type);
Optional<ObjectTypeDefinition> typeDef = typeRetriever.apply(type);
return typeDef.map(objectTypeDefinition -> OperationTypeDefinition.newOperationTypeDefinition().name(opName).typeName(type).build());
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/graphql/schema/idl/ScalarInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class ScalarInfo {
*
* @param scalarTypeName the name of the scalar type in question
*
* @return true if the scalar type is is specified by the graphql specification
* @return true if the scalar type is specified by the graphql specification
*/
public static boolean isGraphqlSpecifiedScalar(String scalarTypeName) {
return inList(GRAPHQL_SPECIFICATION_SCALARS, scalarTypeName);
Expand All @@ -60,7 +60,7 @@ public static boolean isGraphqlSpecifiedScalar(String scalarTypeName) {
*
* @param scalarType the type in question
*
* @return true if the scalar type is is specified by the graphql specification
* @return true if the scalar type is specified by the graphql specification
*/
public static boolean isGraphqlSpecifiedScalar(GraphQLScalarType scalarType) {
return inList(GRAPHQL_SPECIFICATION_SCALARS, scalarType.getName());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/graphql/schema/idl/SchemaPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public Options includeSchemaDefinition(boolean flag) {
/**
* This flag controls whether schema printer will include directive definitions at the top of the schema, but does not remove them from the field or type usage.
* <p>
* In some schema defintions, like Apollo Federation, the schema should be printed without the directive definitions.
* In some schema definitions, like Apollo Federation, the schema should be printed without the directive definitions.
* This simplified schema is returned by a GraphQL query to other services, in a format that is different that the introspection query.
* <p>
* On by default.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/graphql/schema/idl/SchemaTypeChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static <T, E extends GraphQLError> void checkNamedUniqueness(List<GraphQLError>

private void checkTypeResolversArePresent(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, RuntimeWiring wiring) {

Predicate<InterfaceTypeDefinition> noDynamicResolverForInterface = interaceTypeDef -> !wiring.getWiringFactory().providesTypeResolver(new InterfaceWiringEnvironment(typeRegistry, interaceTypeDef));
Predicate<InterfaceTypeDefinition> noDynamicResolverForInterface = interfaceTypeDef -> !wiring.getWiringFactory().providesTypeResolver(new InterfaceWiringEnvironment(typeRegistry, interfaceTypeDef));
Predicate<UnionTypeDefinition> noDynamicResolverForUnion = unionTypeDef -> !wiring.getWiringFactory().providesTypeResolver(new UnionWiringEnvironment(typeRegistry, unionTypeDef));

Predicate<TypeDefinition> noTypeResolver = typeDefinition -> !wiring.getTypeResolvers().containsKey(typeDefinition.getName());
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/graphql/util/TraverserContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ enum Phase {
* Obtains all visited nodes and values received by the {@link TraverserVisitor#enter(graphql.util.TraverserContext) }
* method
*
* @return a map containg all nodes visited and values passed when visiting nodes for the first time
* @return a map containing all nodes visited and values passed when visiting nodes for the first time
*/
Set<T> visitedNodes();

Expand Down Expand Up @@ -148,7 +148,7 @@ enum Phase {
/**
* Stores a variable in the context
*
* @param <S> type of a varable
* @param <S> type of a variable
* @param key key to create bindings for the variable
* @param value value of variable
*
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/graphql/util/TreeTransformerUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public static <T> TraversalControl changeNode(TraverserContext<T> context, T cha
boolean changed = context.isChanged();
if (context.isParallel()) {
List<NodeZipper<T>> zippers = context.getVar(List.class);
NodeAdapter adaper = context.getVar(NodeAdapter.class);
NodeAdapter adapter = context.getVar(NodeAdapter.class);
if (changed) {
replaceZipperForNode(zippers, context.thisNode(), changedNode);
context.changeNode(changedNode);
} else {
NodeZipper<T> nodeZipper = new NodeZipper<>(changedNode, context.getBreadcrumbs(), adaper);
NodeZipper<T> nodeZipper = new NodeZipper<>(changedNode, context.getBreadcrumbs(), adapter);
zippers.add(nodeZipper);
context.changeNode(changedNode);
}
Expand Down Expand Up @@ -57,8 +57,8 @@ private static <T> void replaceZipperForNode(List<NodeZipper<T>> zippers, T curr

public static <T> TraversalControl deleteNode(TraverserContext<T> context) {
if (context.isParallel()) {
NodeAdapter adaper = context.getVar(NodeAdapter.class);
NodeZipper<T> deleteNodeZipper = new NodeZipper<>(context.thisNode(), context.getBreadcrumbs(), adaper).deleteNode();
NodeAdapter adapter = context.getVar(NodeAdapter.class);
NodeZipper<T> deleteNodeZipper = new NodeZipper<>(context.thisNode(), context.getBreadcrumbs(), adapter).deleteNode();
List<NodeZipper<T>> zippers = context.getVar(List.class);
zippers.add(deleteNodeZipper);
context.deleteNode();
Expand All @@ -74,8 +74,8 @@ public static <T> TraversalControl deleteNode(TraverserContext<T> context) {

public static <T> TraversalControl insertAfter(TraverserContext<T> context, T toInsertAfter) {
if (context.isParallel()) {
NodeAdapter adaper = context.getVar(NodeAdapter.class);
NodeZipper<T> insertNodeZipper = new NodeZipper<>(context.originalThisNode(), context.getBreadcrumbs(), adaper).insertAfter(toInsertAfter);
NodeAdapter adapter = context.getVar(NodeAdapter.class);
NodeZipper<T> insertNodeZipper = new NodeZipper<>(context.originalThisNode(), context.getBreadcrumbs(), adapter).insertAfter(toInsertAfter);
List<NodeZipper<T>> zippers = context.getVar(List.class);
zippers.add(insertNodeZipper);
return TraversalControl.CONTINUE;
Expand All @@ -89,8 +89,8 @@ public static <T> TraversalControl insertAfter(TraverserContext<T> context, T to

public static <T> TraversalControl insertBefore(TraverserContext<T> context, T toInsertBefore) {
if (context.isParallel()) {
NodeAdapter adaper = context.getVar(NodeAdapter.class);
NodeZipper<T> insertNodeZipper = new NodeZipper<>(context.originalThisNode(), context.getBreadcrumbs(), adaper).insertBefore(toInsertBefore);
NodeAdapter adapter = context.getVar(NodeAdapter.class);
NodeZipper<T> insertNodeZipper = new NodeZipper<>(context.originalThisNode(), context.getBreadcrumbs(), adapter).insertBefore(toInsertBefore);
List<NodeZipper<T>> zippers = context.getVar(List.class);
zippers.add(insertNodeZipper);
return TraversalControl.CONTINUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private GraphQLFieldDefinition getVisibleFieldDefinition(GraphQLFieldsContainer


private List<Conflict> findConflicts(Map<String, Set<FieldAndType>> fieldMap) {
/**
/*
* The algorithm implemented here is not the one from the Spec, but is based on
* https://tech.xing.com/graphql-overlapping-fields-can-be-merged-fast-ea6e92e0a01
* . It is not the final version (Listing 11), but Listing 10 adopted to this code base.
Expand Down