├── .cargo └── config.toml ├── .circleci └── config.yml ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── docs.md │ └── feature_request.md └── renovate.json5 ├── .gitignore ├── ARCHITECTURE.md ├── CONTRIBUTING.md ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── crates ├── apollo-compiler │ ├── CHANGELOG.md │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── benches │ │ ├── directives_validation.rs │ │ ├── fields_validation.rs │ │ ├── fragments_validation.rs │ │ ├── multi_source.rs │ │ └── testdata │ │ │ ├── simple_query.graphql │ │ │ ├── simple_schema.graphql │ │ │ ├── supergraph.graphql │ │ │ └── supergraph_query.graphql │ ├── examples │ │ ├── documents │ │ │ ├── get_dog_name.graphql │ │ │ ├── get_dog_with_fragments.graphql │ │ │ ├── schema.graphql │ │ │ └── schema_extension.graphql │ │ ├── extract_directives_used_by_query.rs │ │ ├── file_watcher.rs │ │ ├── hello_world.rs │ │ ├── introspect.rs │ │ ├── multi_source_validation.rs │ │ ├── query_with_errors.graphql │ │ ├── rename.rs │ │ ├── timed.rs │ │ └── validate.rs │ ├── src │ │ ├── ast │ │ │ ├── from_cst.rs │ │ │ ├── impls.rs │ │ │ ├── mod.rs │ │ │ └── serialize.rs │ │ ├── built_in_types.graphql │ │ ├── collections.rs │ │ ├── coordinate.rs │ │ ├── diagnostic.rs │ │ ├── executable │ │ │ ├── from_ast.rs │ │ │ ├── mod.rs │ │ │ ├── serialize.rs │ │ │ └── validation.rs │ │ ├── execution │ │ │ ├── engine.rs │ │ │ ├── input_coercion.rs │ │ │ ├── mod.rs │ │ │ ├── resolver.rs │ │ │ └── result_coercion.rs │ │ ├── introspection │ │ │ ├── max_depth.rs │ │ │ ├── mod.rs │ │ │ └── resolvers.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── name.rs │ │ ├── node.rs │ │ ├── parser.rs │ │ ├── request.rs │ │ ├── response.rs │ │ ├── schema │ │ │ ├── component.rs │ │ │ ├── from_ast.rs │ │ │ ├── mod.rs │ │ │ ├── serialize.rs │ │ │ └── validation.rs │ │ └── validation │ │ │ ├── argument.rs │ │ │ ├── diagnostics.rs │ │ │ ├── directive.rs │ │ │ ├── enum_.rs │ │ │ ├── field.rs │ │ │ ├── fragment.rs │ │ │ ├── input_object.rs │ │ │ ├── interface.rs │ │ │ ├── mod.rs │ │ │ ├── object.rs │ │ │ ├── operation.rs │ │ │ ├── scalar.rs │ │ │ ├── schema.rs │ │ │ ├── selection.rs │ │ │ ├── union_.rs │ │ │ ├── value.rs │ │ │ └── variable.rs │ ├── test_data │ │ ├── diagnostics │ │ │ ├── 0001_duplicate_operatoin_names.graphql │ │ │ ├── 0001_duplicate_operatoin_names.txt │ │ │ ├── 0002_multiple_anonymous_operations.graphql │ │ │ ├── 0002_multiple_anonymous_operations.txt │ │ │ ├── 0003_anonymous_and_named_operation.graphql │ │ │ ├── 0003_anonymous_and_named_operation.txt │ │ │ ├── 0004_subscription_with_multiple_root_fields.graphql │ │ │ ├── 0004_subscription_with_multiple_root_fields.txt │ │ │ ├── 0005_subscription_with_multiple_root_fields_in_fragment_spreads.graphql │ │ │ ├── 0005_subscription_with_multiple_root_fields_in_fragment_spreads.txt │ │ │ ├── 0006_subscription_with_multiple_root_fields_in_inline_fragments.graphql │ │ │ ├── 0006_subscription_with_multiple_root_fields_in_inline_fragments.txt │ │ │ ├── 0007_operation_with_undefined_variables.graphql │ │ │ ├── 0007_operation_with_undefined_variables.txt │ │ │ ├── 0008_operation_with_undefined_variables_in_inline_fragment.graphql │ │ │ ├── 0008_operation_with_undefined_variables_in_inline_fragment.txt │ │ │ ├── 0009_operation_with_undefined_variables_in_fragment.graphql │ │ │ ├── 0009_operation_with_undefined_variables_in_fragment.txt │ │ │ ├── 0010_operation_with_unused_variable.graphql │ │ │ ├── 0010_operation_with_unused_variable.txt │ │ │ ├── 0011_syntactic_errors_from_parser.graphql │ │ │ ├── 0011_syntactic_errors_from_parser.txt │ │ │ ├── 0012_schema_definition_with_missing_query_operation_type.graphql │ │ │ ├── 0012_schema_definition_with_missing_query_operation_type.txt │ │ │ ├── 0013_schema_definition_with_duplicate_root_type_operations.graphql │ │ │ ├── 0013_schema_definition_with_duplicate_root_type_operations.txt │ │ │ ├── 0014_subscription_operation_without_subscription_schema_operation_type.graphql │ │ │ ├── 0014_subscription_operation_without_subscription_schema_operation_type.txt │ │ │ ├── 0015_mutation_operation_without_mutation_schema_definition.graphql │ │ │ ├── 0015_mutation_operation_without_mutation_schema_definition.txt │ │ │ ├── 0016_schema_with_built_in_scalar_definition.graphql │ │ │ ├── 0016_schema_with_built_in_scalar_definition.txt │ │ │ ├── 0017_schema_with_unspecified_scalar.graphql │ │ │ ├── 0017_schema_with_unspecified_scalar.txt │ │ │ ├── 0018_schema_with_specified_scalar_missing_values.graphql │ │ │ ├── 0018_schema_with_specified_scalar_missing_values.txt │ │ │ ├── 0019_enum_definition_with_duplicate_values.graphql │ │ │ ├── 0019_enum_definition_with_duplicate_values.txt │ │ │ ├── 0020_enum_values_with_uncapitalised_values.graphql │ │ │ ├── 0020_enum_values_with_uncapitalised_values.txt │ │ │ ├── 0021_union_definition_with_duplicate_members.graphql │ │ │ ├── 0021_union_definition_with_duplicate_members.txt │ │ │ ├── 0022_duplicate_interface_definitions.graphql │ │ │ ├── 0022_duplicate_interface_definitions.txt │ │ │ ├── 0023_interface_definition_with_cyclic_implements_interfaces.graphql │ │ │ ├── 0023_interface_definition_with_cyclic_implements_interfaces.txt │ │ │ ├── 0024_interface_definition_with_duplicate_fields.graphql │ │ │ ├── 0024_interface_definition_with_duplicate_fields.txt │ │ │ ├── 0025_interface_definition_with_missing_transitive_fields.graphql │ │ │ ├── 0025_interface_definition_with_missing_transitive_fields.txt │ │ │ ├── 0026_interface_definition_with_missing_implemetns_interface.graphql │ │ │ ├── 0026_interface_definition_with_missing_implemetns_interface.txt │ │ │ ├── 0027_interface_definition_with_undefined_implements_interface.graphql │ │ │ ├── 0027_interface_definition_with_undefined_implements_interface.txt │ │ │ ├── 0028_interface_definition_with_missing_fields_implements_intrefaces_undefined_interfaces.graphql │ │ │ ├── 0028_interface_definition_with_missing_fields_implements_intrefaces_undefined_interfaces.txt │ │ │ ├── 0029_directive_definitions_with_duplicate_names.graphql │ │ │ ├── 0029_directive_definitions_with_duplicate_names.txt │ │ │ ├── 0030_schema_with_duplicate_input_objects.graphql │ │ │ ├── 0030_schema_with_duplicate_input_objects.txt │ │ │ ├── 0031_input_object_with_duplicate_fields.graphql │ │ │ ├── 0031_input_object_with_duplicate_fields.txt │ │ │ ├── 0032_duplicate_object_type_definition.graphql │ │ │ ├── 0032_duplicate_object_type_definition.txt │ │ │ ├── 0033_object_type_definition_with_duplicate_fields.graphql │ │ │ ├── 0033_object_type_definition_with_duplicate_fields.txt │ │ │ ├── 0034_object_type_definition_with_missing_transitive_fields.graphql │ │ │ ├── 0034_object_type_definition_with_missing_transitive_fields.txt │ │ │ ├── 0035_object_type_definition_with_missing_implements_interfaces_definition.graphql │ │ │ ├── 0035_object_type_definition_with_missing_implements_interfaces_definition.txt │ │ │ ├── 0036_object_type_with_non_output_field_types.graphql │ │ │ ├── 0036_object_type_with_non_output_field_types.txt │ │ │ ├── 0037_interface_with_non_output_fields.graphql │ │ │ ├── 0037_interface_with_non_output_fields.txt │ │ │ ├── 0038_object_type_with_undefined_field_type.graphql │ │ │ ├── 0038_object_type_with_undefined_field_type.txt │ │ │ ├── 0039_interface_with_undefined_field_type.graphql │ │ │ ├── 0039_interface_with_undefined_field_type.txt │ │ │ ├── 0040_operation_with_undefined_fields_on_reference_type.graphql │ │ │ ├── 0040_operation_with_undefined_fields_on_reference_type.txt │ │ │ ├── 0041_subscription_operation_with_undefined_fields.graphql │ │ │ ├── 0041_subscription_operation_with_undefined_fields.txt │ │ │ ├── 0042_mutation_operation_with_undefined_fields.graphql │ │ │ ├── 0042_mutation_operation_with_undefined_fields.txt │ │ │ ├── 0043_undefined_union_member.graphql │ │ │ ├── 0043_undefined_union_member.txt │ │ │ ├── 0044_union_member_not_of_object_type.graphql │ │ │ ├── 0044_union_member_not_of_object_type.txt │ │ │ ├── 0045_operation_with_unused_variable_in_fragment.graphql │ │ │ ├── 0045_operation_with_unused_variable_in_fragment.txt │ │ │ ├── 0046_duplicate_directive_arguments.graphql │ │ │ ├── 0046_duplicate_directive_arguments.txt │ │ │ ├── 0047_duplicate_field_arguments.graphql │ │ │ ├── 0047_duplicate_field_arguments.txt │ │ │ ├── 0048_duplicate_field_argument_definition_names.graphql │ │ │ ├── 0048_duplicate_field_argument_definition_names.txt │ │ │ ├── 0049_duplicate_directive_argument_definition_names.graphql │ │ │ ├── 0049_duplicate_directive_argument_definition_names.txt │ │ │ ├── 0050_directives_in_invalid_locations.graphql │ │ │ ├── 0050_directives_in_invalid_locations.txt │ │ │ ├── 0051_subscription_operation_with_root_introspection_field.graphql │ │ │ ├── 0051_subscription_operation_with_root_introspection_field.txt │ │ │ ├── 0052_undefined_directive.graphql │ │ │ ├── 0052_undefined_directive.txt │ │ │ ├── 0053_argument_name_is_not_defined.graphql │ │ │ ├── 0053_argument_name_is_not_defined.txt │ │ │ ├── 0054_argument_not_provided.graphql │ │ │ ├── 0054_argument_not_provided.txt │ │ │ ├── 0055_duplicate_variable_definitions.graphql │ │ │ ├── 0055_duplicate_variable_definitions.txt │ │ │ ├── 0056_variables_are_input_types.graphql │ │ │ ├── 0056_variables_are_input_types.txt │ │ │ ├── 0057_duplicate_type_names.graphql │ │ │ ├── 0057_duplicate_type_names.txt │ │ │ ├── 0058_fragment_definitions_with_duplicate_names.graphql │ │ │ ├── 0058_fragment_definitions_with_duplicate_names.txt │ │ │ ├── 0059_root_operation_object_type.graphql │ │ │ ├── 0059_root_operation_object_type.txt │ │ │ ├── 0060_root_operation_definition_undefined_operation_type.graphql │ │ │ ├── 0060_root_operation_definition_undefined_operation_type.txt │ │ │ ├── 0061_root_operation_with_default_undefined_query.graphql │ │ │ ├── 0061_root_operation_with_default_undefined_query.txt │ │ │ ├── 0062_root_operation_with_list.graphql │ │ │ ├── 0062_root_operation_with_list.txt │ │ │ ├── 0063_extension_orphan.graphql │ │ │ ├── 0063_extension_orphan.txt │ │ │ ├── 0064_extension_wrong_type.graphql │ │ │ ├── 0064_extension_wrong_type.txt │ │ │ ├── 0065_subselection_of_enum.graphql │ │ │ ├── 0065_subselection_of_enum.txt │ │ │ ├── 0066_subselection_of_scalar.graphql │ │ │ ├── 0066_subselection_of_scalar.txt │ │ │ ├── 0067_subselection_of_interface.graphql │ │ │ ├── 0067_subselection_of_interface.txt │ │ │ ├── 0068_subselection_of_union.graphql │ │ │ ├── 0068_subselection_of_union.txt │ │ │ ├── 0069_subselection_of_object.graphql │ │ │ ├── 0069_subselection_of_object.txt │ │ │ ├── 0070_self_referential_directive_definition.graphql │ │ │ ├── 0070_self_referential_directive_definition.txt │ │ │ ├── 0074_merge_identical_fields.graphql │ │ │ ├── 0074_merge_identical_fields.txt │ │ │ ├── 0075_merge_conflicting_args.graphql │ │ │ ├── 0075_merge_conflicting_args.txt │ │ │ ├── 0076_merge_differing_responses.graphql │ │ │ ├── 0076_merge_differing_responses.txt │ │ │ ├── 0077_merge_conflict_deep.graphql │ │ │ ├── 0077_merge_conflict_deep.txt │ │ │ ├── 0078_merge_conflict_nested_fragments.graphql │ │ │ ├── 0078_merge_conflict_nested_fragments.txt │ │ │ ├── 0079_directive_is_unique.graphql │ │ │ ├── 0079_directive_is_unique.txt │ │ │ ├── 0080_directive_is_unique_with_extensions.graphql │ │ │ ├── 0080_directive_is_unique_with_extensions.txt │ │ │ ├── 0081_directive_is_unique_type_system.graphql │ │ │ ├── 0081_directive_is_unique_type_system.txt │ │ │ ├── 0082_introspection_types_in_mutation.graphql │ │ │ ├── 0082_introspection_types_in_mutation.txt │ │ │ ├── 0083_type_introspection_from_disallowed_type.graphql │ │ │ ├── 0083_type_introspection_from_disallowed_type.txt │ │ │ ├── 0084_circular_non_nullable_input_objects.graphql │ │ │ ├── 0084_circular_non_nullable_input_objects.txt │ │ │ ├── 0085_fragment_spread_target_defined.graphql │ │ │ ├── 0085_fragment_spread_target_defined.txt │ │ │ ├── 0086_unused_fragment.graphql │ │ │ ├── 0086_unused_fragment.txt │ │ │ ├── 0087_fragment_type_condition_on_composite_types.graphql │ │ │ ├── 0087_fragment_type_condition_on_composite_types.txt │ │ │ ├── 0088_fragment_selection_set.graphql │ │ │ ├── 0088_fragment_selection_set.txt │ │ │ ├── 0089_fragment_type_condition_on_non_existent_types.graphql │ │ │ ├── 0089_fragment_type_condition_on_non_existent_types.txt │ │ │ ├── 0090_fragment_spread_impossible.graphql │ │ │ ├── 0090_fragment_spread_impossible.txt │ │ │ ├── 0091_recursive_interface_definition.graphql │ │ │ ├── 0091_recursive_interface_definition.txt │ │ │ ├── 0092_recursive_fragment_spread.graphql │ │ │ ├── 0092_recursive_fragment_spread.txt │ │ │ ├── 0093_fragment_validation_with_recursive_type_system.graphql │ │ │ ├── 0093_fragment_validation_with_recursive_type_system.txt │ │ │ ├── 0094_object_type_extensions.graphql │ │ │ ├── 0094_object_type_extensions.txt │ │ │ ├── 0095_interface_implementation_declared_once.graphql │ │ │ ├── 0095_interface_implementation_declared_once.txt │ │ │ ├── 0096_schema_extensions.graphql │ │ │ ├── 0096_schema_extensions.txt │ │ │ ├── 0097_enum_extensions.graphql │ │ │ ├── 0097_enum_extensions.txt │ │ │ ├── 0098_interface_extensions.graphql │ │ │ ├── 0098_interface_extensions.txt │ │ │ ├── 0099_input_object_extensions.graphql │ │ │ ├── 0099_input_object_extensions.txt │ │ │ ├── 0100_union_extensions.graphql │ │ │ ├── 0100_union_extensions.txt │ │ │ ├── 0101_mismatched_variable_usage.graphql │ │ │ ├── 0101_mismatched_variable_usage.txt │ │ │ ├── 0102_invalid_string_values.graphql │ │ │ ├── 0102_invalid_string_values.txt │ │ │ ├── 0103_invalid_directive_on_input_value.graphql │ │ │ ├── 0103_invalid_directive_on_input_value.txt │ │ │ ├── 0104_invalid_type_in_arg.graphql │ │ │ ├── 0104_invalid_type_in_arg.txt │ │ │ ├── 0105_executable_definition_in_type_system_document.graphql │ │ │ ├── 0105_executable_definition_in_type_system_document.txt │ │ │ ├── 0106_type_system_definition_in_executable_document.graphql │ │ │ ├── 0106_type_system_definition_in_executable_document.txt │ │ │ ├── 0107_built_in_directive_double_redefinition.graphql │ │ │ ├── 0107_built_in_directive_double_redefinition.txt │ │ │ ├── 0108_implicit_schema_extension.graphql │ │ │ ├── 0108_implicit_schema_extension.txt │ │ │ ├── 0109_null_in_list_issue_738.graphql │ │ │ ├── 0109_null_in_list_issue_738.txt │ │ │ ├── 0110_list_usage_in_non_list_type.graphql │ │ │ ├── 0110_list_usage_in_non_list_type.txt │ │ │ ├── 0111_const_value.graphql │ │ │ ├── 0111_const_value.txt │ │ │ ├── 0112_anonymous_subscription_with_multiple_root_fields.graphql │ │ │ ├── 0112_anonymous_subscription_with_multiple_root_fields.txt │ │ │ ├── 0113_partially_overlapping_fragments.graphql │ │ │ ├── 0113_partially_overlapping_fragments.txt │ │ │ ├── 0114_interface_definition_with_missing_fields.graphql │ │ │ ├── 0114_interface_definition_with_missing_fields.txt │ │ │ ├── 0115_object_definition_with_missing_fields.graphql │ │ │ ├── 0115_object_definition_with_missing_fields.txt │ │ │ ├── 0116_enum_definition_with_missing_values.graphql │ │ │ ├── 0116_enum_definition_with_missing_values.txt │ │ │ ├── 0117_union_definition_with_missing_members.graphql │ │ │ ├── 0117_union_definition_with_missing_members.txt │ │ │ ├── 0118_input_object_definition_with_missing_values.graphql │ │ │ ├── 0118_input_object_definition_with_missing_values.txt │ │ │ ├── 0119_reserved_names.graphql │ │ │ ├── 0119_reserved_names.txt │ │ │ ├── 0120_conditional_subscriptions.graphql │ │ │ ├── 0120_conditional_subscriptions.txt │ │ │ ├── 0121_conditional_subscriptions_with_inline_fragment.graphql │ │ │ ├── 0121_conditional_subscriptions_with_inline_fragment.txt │ │ │ ├── 0122_conditional_subscriptions_with_named_fragment.graphql │ │ │ ├── 0122_conditional_subscriptions_with_named_fragment.txt │ │ │ ├── 0123_conditional_subscriptions_inside_inline_fragment.graphql │ │ │ ├── 0123_conditional_subscriptions_inside_inline_fragment.txt │ │ │ ├── 0124_conditional_subscriptions_inside_named_fragment.graphql │ │ │ └── 0124_conditional_subscriptions_inside_named_fragment.txt │ │ ├── introspection │ │ │ ├── introspect_full_schema.graphql │ │ │ └── response_full.json │ │ ├── ok │ │ │ ├── 0001_annonymous_operation_definition.graphql │ │ │ ├── 0001_annonymous_operation_definition.txt │ │ │ ├── 0002_multiple_named_operation_definitions.graphql │ │ │ ├── 0002_multiple_named_operation_definitions.txt │ │ │ ├── 0003_schema_definition_with_custom_operation_types.graphql │ │ │ ├── 0003_schema_definition_with_custom_operation_types.txt │ │ │ ├── 0004_schema_with_custom_scalars.graphql │ │ │ ├── 0004_schema_with_custom_scalars.txt │ │ │ ├── 0005_schema_with_valid_enum_definitions.graphql │ │ │ ├── 0005_schema_with_valid_enum_definitions.txt │ │ │ ├── 0006_schema_with_valid_union.graphql │ │ │ ├── 0006_schema_with_valid_union.txt │ │ │ ├── 0007_schema_with_interface_definition.graphql │ │ │ ├── 0007_schema_with_interface_definition.txt │ │ │ ├── 0008_schema_with_directive_definition.graphql │ │ │ ├── 0008_schema_with_directive_definition.txt │ │ │ ├── 0009_schema_with_input_object.graphql │ │ │ ├── 0009_schema_with_input_object.txt │ │ │ ├── 0010_operation_with_defined_fields.graphql │ │ │ ├── 0010_operation_with_defined_fields.txt │ │ │ ├── 0011_fragment_spreads_in_fragment_definitions.graphql │ │ │ ├── 0011_fragment_spreads_in_fragment_definitions.txt │ │ │ ├── 0012_introspection_query.graphql │ │ │ ├── 0012_introspection_query.txt │ │ │ ├── 0013_operation_with_used_variable_in_fragment.graphql │ │ │ ├── 0013_operation_with_used_variable_in_fragment.txt │ │ │ ├── 0014_float_values.graphql │ │ │ ├── 0014_float_values.txt │ │ │ ├── 0015_supergraph.graphql │ │ │ ├── 0015_supergraph.txt │ │ │ ├── 0016_same_variables_in_multiple_operations.graphql │ │ │ ├── 0016_same_variables_in_multiple_operations.txt │ │ │ ├── 0017_variables_are_input_types.graphql │ │ │ ├── 0017_variables_are_input_types.txt │ │ │ ├── 0018_non_clashing_names.graphql │ │ │ ├── 0018_non_clashing_names.txt │ │ │ ├── 0019_extensions.graphql │ │ │ ├── 0019_extensions.txt │ │ │ ├── 0020_merge_identical_fields.graphql │ │ │ ├── 0020_merge_identical_fields.txt │ │ │ ├── 0021_merge_identical_fields_with_arguments.graphql │ │ │ ├── 0021_merge_identical_fields_with_arguments.txt │ │ │ ├── 0022_merge_differing_fields_and_args.graphql │ │ │ ├── 0022_merge_differing_fields_and_args.txt │ │ │ ├── 0024_used_variables_in_directives.graphql │ │ │ ├── 0024_used_variables_in_directives.txt │ │ │ ├── 0025_unique_directives.graphql │ │ │ ├── 0025_unique_directives.txt │ │ │ ├── 0026_type_introspection.graphql │ │ │ ├── 0026_type_introspection.txt │ │ │ ├── 0027_typename_introspection.txt │ │ │ ├── 0027_typename_introspection_in_object.graphql │ │ │ ├── 0027_typename_introspection_in_object.txt │ │ │ ├── 0028_typename_introspection_in_union.graphql │ │ │ ├── 0028_typename_introspection_in_union.txt │ │ │ ├── 0029_used_variable_in_list_and_input.graphql │ │ │ ├── 0029_used_variable_in_list_and_input.txt │ │ │ ├── 0030_cyclical_nullable_input_objects.graphql │ │ │ ├── 0030_cyclical_nullable_input_objects.txt │ │ │ ├── 0031_fragment_spread_possible.graphql │ │ │ ├── 0031_fragment_spread_possible.txt │ │ │ ├── 0032_valid_of_correct_type.graphql │ │ │ ├── 0032_valid_of_correct_type.txt │ │ │ ├── 0033_valid_variable_usage.graphql │ │ │ ├── 0033_valid_variable_usage.txt │ │ │ ├── 0034_built_in_directive_redefinition.graphql │ │ │ ├── 0034_built_in_directive_redefinition.txt │ │ │ ├── 0035_implicit_schema_definition_with_query_type.graphql │ │ │ ├── 0035_implicit_schema_definition_with_query_type.txt │ │ │ ├── 0036_implicit_schema_definition_with_several_default_types.graphql │ │ │ ├── 0036_implicit_schema_definition_with_several_default_types.txt │ │ │ ├── 0037_implicit_schema_extension_with_directive.graphql │ │ │ ├── 0037_implicit_schema_extension_with_directive.txt │ │ │ ├── 0038_argument_default.graphql │ │ │ ├── 0038_argument_default.txt │ │ │ ├── 0039_string_literals.graphql │ │ │ ├── 0039_string_literals.txt │ │ │ ├── 0040_field_merging_issue_755.graphql │ │ │ ├── 0040_field_merging_issue_755.txt │ │ │ ├── 0041_unquoted_string_for_custom_scalar.graphql │ │ │ ├── 0041_unquoted_string_for_custom_scalar.txt │ │ │ ├── 0042_used_variable_in_operation_directive.graphql │ │ │ ├── 0042_used_variable_in_operation_directive.txt │ │ │ ├── 0115_interface_definition_with_extension_defines_field.graphql │ │ │ ├── 0115_interface_definition_with_extension_defines_field.txt │ │ │ ├── 0116_interface_without_implementations.graphql │ │ │ ├── 0116_interface_without_implementations.txt │ │ │ ├── 0117_subscription_conditions_not_at_root.graphql │ │ │ └── 0117_subscription_conditions_not_at_root.txt │ │ └── serializer │ │ │ ├── diagnostics │ │ │ ├── 0001_duplicate_operatoin_names.graphql │ │ │ ├── 0002_multiple_anonymous_operations.graphql │ │ │ ├── 0003_anonymous_and_named_operation.graphql │ │ │ ├── 0004_subscription_with_multiple_root_fields.graphql │ │ │ ├── 0005_subscription_with_multiple_root_fields_in_fragment_spreads.graphql │ │ │ ├── 0006_subscription_with_multiple_root_fields_in_inline_fragments.graphql │ │ │ ├── 0007_operation_with_undefined_variables.graphql │ │ │ ├── 0008_operation_with_undefined_variables_in_inline_fragment.graphql │ │ │ ├── 0009_operation_with_undefined_variables_in_fragment.graphql │ │ │ ├── 0010_operation_with_unused_variable.graphql │ │ │ ├── 0011_syntactic_errors_from_parser.graphql │ │ │ ├── 0012_schema_definition_with_missing_query_operation_type.graphql │ │ │ ├── 0013_schema_definition_with_duplicate_root_type_operations.graphql │ │ │ ├── 0014_subscription_operation_without_subscription_schema_operation_type.graphql │ │ │ ├── 0015_mutation_operation_without_mutation_schema_definition.graphql │ │ │ ├── 0016_schema_with_built_in_scalar_definition.graphql │ │ │ ├── 0017_schema_with_unspecified_scalar.graphql │ │ │ ├── 0018_schema_with_specified_scalar_missing_values.graphql │ │ │ ├── 0019_enum_definition_with_duplicate_values.graphql │ │ │ ├── 0020_enum_values_with_uncapitalised_values.graphql │ │ │ ├── 0021_union_definition_with_duplicate_members.graphql │ │ │ ├── 0022_duplicate_interface_definitions.graphql │ │ │ ├── 0023_interface_definition_with_cyclic_implements_interfaces.graphql │ │ │ ├── 0024_interface_definition_with_duplicate_fields.graphql │ │ │ ├── 0025_interface_definition_with_missing_transitive_fields.graphql │ │ │ ├── 0026_interface_definition_with_missing_implemetns_interface.graphql │ │ │ ├── 0027_interface_definition_with_undefined_implements_interface.graphql │ │ │ ├── 0028_interface_definition_with_missing_fields_implements_intrefaces_undefined_interfaces.graphql │ │ │ ├── 0029_directive_definitions_with_duplicate_names.graphql │ │ │ ├── 0030_schema_with_duplicate_input_objects.graphql │ │ │ ├── 0031_input_object_with_duplicate_fields.graphql │ │ │ ├── 0032_duplicate_object_type_definition.graphql │ │ │ ├── 0033_object_type_definition_with_duplicate_fields.graphql │ │ │ ├── 0034_object_type_definition_with_missing_transitive_fields.graphql │ │ │ ├── 0035_object_type_definition_with_missing_implements_interfaces_definition.graphql │ │ │ ├── 0036_object_type_with_non_output_field_types.graphql │ │ │ ├── 0037_interface_with_non_output_fields.graphql │ │ │ ├── 0038_object_type_with_undefined_field_type.graphql │ │ │ ├── 0039_interface_with_undefined_field_type.graphql │ │ │ ├── 0040_operation_with_undefined_fields_on_reference_type.graphql │ │ │ ├── 0041_subscription_operation_with_undefined_fields.graphql │ │ │ ├── 0042_mutation_operation_with_undefined_fields.graphql │ │ │ ├── 0043_undefined_union_member.graphql │ │ │ ├── 0044_union_member_not_of_object_type.graphql │ │ │ ├── 0045_operation_with_unused_variable_in_fragment.graphql │ │ │ ├── 0046_duplicate_directive_arguments.graphql │ │ │ ├── 0047_duplicate_field_arguments.graphql │ │ │ ├── 0048_duplicate_field_argument_definition_names.graphql │ │ │ ├── 0049_duplicate_directive_argument_definition_names.graphql │ │ │ ├── 0050_directives_in_invalid_locations.graphql │ │ │ ├── 0051_subscription_operation_with_root_introspection_field.graphql │ │ │ ├── 0052_undefined_directive.graphql │ │ │ ├── 0053_argument_name_is_not_defined.graphql │ │ │ ├── 0054_argument_not_provided.graphql │ │ │ ├── 0055_duplicate_variable_definitions.graphql │ │ │ ├── 0056_variables_are_input_types.graphql │ │ │ ├── 0057_duplicate_type_names.graphql │ │ │ ├── 0058_fragment_definitions_with_duplicate_names.graphql │ │ │ ├── 0059_root_operation_object_type.graphql │ │ │ ├── 0060_root_operation_definition_undefined_operation_type.graphql │ │ │ ├── 0061_root_operation_with_default_undefined_query.graphql │ │ │ ├── 0062_root_operation_with_list.graphql │ │ │ ├── 0063_extension_orphan.graphql │ │ │ ├── 0064_extension_wrong_type.graphql │ │ │ ├── 0065_subselection_of_enum.graphql │ │ │ ├── 0066_subselection_of_scalar.graphql │ │ │ ├── 0067_subselection_of_interface.graphql │ │ │ ├── 0068_subselection_of_union.graphql │ │ │ ├── 0069_subselection_of_object.graphql │ │ │ ├── 0070_self_referential_directive_definition.graphql │ │ │ ├── 0074_merge_identical_fields.graphql │ │ │ ├── 0075_merge_conflicting_args.graphql │ │ │ ├── 0076_merge_differing_responses.graphql │ │ │ ├── 0077_merge_conflict_deep.graphql │ │ │ ├── 0078_merge_conflict_nested_fragments.graphql │ │ │ ├── 0079_directive_is_unique.graphql │ │ │ ├── 0080_directive_is_unique_with_extensions.graphql │ │ │ ├── 0081_directive_is_unique_type_system.graphql │ │ │ ├── 0082_introspection_types_in_mutation.graphql │ │ │ ├── 0083_type_introspection_from_disallowed_type.graphql │ │ │ ├── 0084_circular_non_nullable_input_objects.graphql │ │ │ ├── 0085_fragment_spread_target_defined.graphql │ │ │ ├── 0086_unused_fragment.graphql │ │ │ ├── 0087_fragment_type_condition_on_composite_types.graphql │ │ │ ├── 0088_fragment_selection_set.graphql │ │ │ ├── 0089_fragment_type_condition_on_non_existent_types.graphql │ │ │ ├── 0090_fragment_spread_impossible.graphql │ │ │ ├── 0091_recursive_interface_definition.graphql │ │ │ ├── 0092_recursive_fragment_spread.graphql │ │ │ ├── 0093_fragment_validation_with_recursive_type_system.graphql │ │ │ ├── 0094_object_type_extensions.graphql │ │ │ ├── 0095_interface_implementation_declared_once.graphql │ │ │ ├── 0096_schema_extensions.graphql │ │ │ ├── 0097_enum_extensions.graphql │ │ │ ├── 0098_interface_extensions.graphql │ │ │ ├── 0099_input_object_extensions.graphql │ │ │ ├── 0100_union_extensions.graphql │ │ │ ├── 0101_mismatched_variable_usage.graphql │ │ │ ├── 0102_invalid_string_values.graphql │ │ │ ├── 0103_invalid_directive_on_input_value.graphql │ │ │ ├── 0103_invalid_type_in_arg.graphql │ │ │ ├── 0104_invalid_type_in_arg.graphql │ │ │ ├── 0105_executable_definition_in_type_system_document.graphql │ │ │ ├── 0106_type_system_definition_in_executable_document.graphql │ │ │ ├── 0107_built_in_directive_double_redefinition.graphql │ │ │ ├── 0108_implicit_schema_extension.graphql │ │ │ ├── 0109_null_in_list_issue_738.graphql │ │ │ ├── 0110_list_usage_in_non_list_type.graphql │ │ │ ├── 0111_const_value.graphql │ │ │ ├── 0112_anonymous_subscription_with_multiple_root_fields.graphql │ │ │ ├── 0113_partially_overlapping_fragments.graphql │ │ │ ├── 0114_interface_definition_with_missing_fields.graphql │ │ │ ├── 0115_object_definition_with_missing_fields.graphql │ │ │ ├── 0116_enum_definition_with_missing_values.graphql │ │ │ ├── 0117_union_definition_with_missing_members.graphql │ │ │ ├── 0118_input_object_definition_with_missing_values.graphql │ │ │ ├── 0119_reserved_named.graphql │ │ │ ├── 0119_reserved_names.graphql │ │ │ ├── 0120_conditional_subscriptions.graphql │ │ │ ├── 0121_conditional_subscriptions_with_inline_fragment.graphql │ │ │ ├── 0121_conditional_subscriptions_with_inline_fragments.graphql │ │ │ ├── 0122_conditional_subscriptions_with_named_fragment.graphql │ │ │ ├── 0123_conditional_subscriptions_inside_inline_fragment.graphql │ │ │ └── 0124_conditional_subscriptions_inside_named_fragment.graphql │ │ │ └── ok │ │ │ ├── 0001_annonymous_operation_definition.graphql │ │ │ ├── 0002_multiple_named_operation_definitions.graphql │ │ │ ├── 0003_schema_definition_with_custom_operation_types.graphql │ │ │ ├── 0004_schema_with_custom_scalars.graphql │ │ │ ├── 0005_schema_with_valid_enum_definitions.graphql │ │ │ ├── 0006_schema_with_valid_union.graphql │ │ │ ├── 0007_schema_with_interface_definition.graphql │ │ │ ├── 0008_schema_with_directive_definition.graphql │ │ │ ├── 0009_schema_with_input_object.graphql │ │ │ ├── 0010_operation_with_defined_fields.graphql │ │ │ ├── 0011_fragment_spreads_in_fragment_definitions.graphql │ │ │ ├── 0012_introspection_query.graphql │ │ │ ├── 0013_operation_with_used_variable_in_fragment.graphql │ │ │ ├── 0014_float_values.graphql │ │ │ ├── 0015_supergraph.graphql │ │ │ ├── 0016_same_variables_in_multiple_operations.graphql │ │ │ ├── 0017_variables_are_input_types.graphql │ │ │ ├── 0018_non_clashing_names.graphql │ │ │ ├── 0019_extensions.graphql │ │ │ ├── 0020_merge_identical_fields.graphql │ │ │ ├── 0021_merge_identical_fields_with_arguments.graphql │ │ │ ├── 0022_merge_differing_fields_and_args.graphql │ │ │ ├── 0024_used_variables_in_directives.graphql │ │ │ ├── 0025_unique_directives.graphql │ │ │ ├── 0026_type_introspection.graphql │ │ │ ├── 0027_typename_introspection_in_object.graphql │ │ │ ├── 0028_typename_introspection_in_union.graphql │ │ │ ├── 0029_used_variable_in_list_and_input.graphql │ │ │ ├── 0030_cyclical_nullable_input_objects.graphql │ │ │ ├── 0031_fragment_spread_possible.graphql │ │ │ ├── 0032_valid_of_correct_type.graphql │ │ │ ├── 0033_valid_variable_usage.graphql │ │ │ ├── 0034_built_in_directive_redefinition.graphql │ │ │ ├── 0035_implicit_schema_definition_with_query_type.graphql │ │ │ ├── 0036_implicit_schema_definition_with_several_default_types.graphql │ │ │ ├── 0037_implicit_schema_extension_with_directive.graphql │ │ │ ├── 0038_argument_default.graphql │ │ │ ├── 0039_string_literals.graphql │ │ │ ├── 0040_field_merging_issue_755.graphql │ │ │ ├── 0041_unquoted_string_for_custom_scalar.graphql │ │ │ ├── 0042_used_variable_in_operation_directive.graphql │ │ │ ├── 0115_interface_definition_with_extension_defines_field.graphql │ │ │ ├── 0116_interface_without_implementations.graphql │ │ │ └── 0117_subscription_conditions_not_at_root.graphql │ └── tests │ │ ├── executable.rs │ │ ├── extensions.rs │ │ ├── field_set.rs │ │ ├── field_type.rs │ │ ├── introspection.rs │ │ ├── introspection_max_depth.rs │ │ ├── locations.rs │ │ ├── main.rs │ │ ├── merge_schemas.rs │ │ ├── misc.rs │ │ ├── name.rs │ │ ├── parser.rs │ │ ├── schema.rs │ │ ├── serde.rs │ │ ├── snapshot_tests.rs │ │ └── validation │ │ ├── field_merging.rs │ │ ├── interface.rs │ │ ├── mod.rs │ │ ├── object.rs │ │ ├── operation.rs │ │ ├── recursion.rs │ │ ├── types.rs │ │ └── variable.rs ├── apollo-parser │ ├── CHANGELOG.md │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── benches │ │ ├── query.rs │ │ ├── supergraph.rs │ │ └── testdata │ │ │ └── alias.graphql │ ├── examples │ │ ├── annotate_snippet.rs │ │ ├── ariadne.rs │ │ ├── graph_check_mutation.graphql │ │ ├── schema.graphql │ │ ├── schema_with_errors.graphql │ │ └── unused_vars.rs │ ├── screenshots │ │ └── apollo_parser_error.png │ ├── src │ │ ├── cst │ │ │ ├── generated │ │ │ │ ├── mod.rs │ │ │ │ └── nodes.rs │ │ │ ├── mod.rs │ │ │ └── node_ext.rs │ │ ├── error.rs │ │ ├── lexer │ │ │ ├── cursor.rs │ │ │ ├── lookup.rs │ │ │ ├── mod.rs │ │ │ ├── token.rs │ │ │ └── token_kind.rs │ │ ├── lib.rs │ │ ├── limit.rs │ │ ├── parser │ │ │ ├── generated │ │ │ │ ├── mod.rs │ │ │ │ └── syntax_kind.rs │ │ │ ├── grammar │ │ │ │ ├── argument.rs │ │ │ │ ├── description.rs │ │ │ │ ├── directive.rs │ │ │ │ ├── document.rs │ │ │ │ ├── enum_.rs │ │ │ │ ├── extensions.rs │ │ │ │ ├── field.rs │ │ │ │ ├── fragment.rs │ │ │ │ ├── input.rs │ │ │ │ ├── interface.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── name.rs │ │ │ │ ├── object.rs │ │ │ │ ├── operation.rs │ │ │ │ ├── scalar.rs │ │ │ │ ├── schema.rs │ │ │ │ ├── selection.rs │ │ │ │ ├── ty.rs │ │ │ │ ├── union_.rs │ │ │ │ ├── value.rs │ │ │ │ └── variable.rs │ │ │ ├── language.rs │ │ │ ├── mod.rs │ │ │ ├── syntax_tree.rs │ │ │ └── token_text.rs │ │ └── tests.rs │ └── test_data │ │ ├── lexer │ │ ├── err │ │ │ ├── 0001_unterminated_spread_operator_with_one.graphql │ │ │ ├── 0001_unterminated_spread_operator_with_one.txt │ │ │ ├── 0002_unterminated_spread_operator_with_2.graphql │ │ │ ├── 0002_unterminated_spread_operator_with_2.txt │ │ │ ├── 0003_float_with_incorrect_decimal_point.graphql │ │ │ ├── 0003_float_with_incorrect_decimal_point.txt │ │ │ ├── 0004_unterminated_string_value.graphql │ │ │ ├── 0004_unterminated_string_value.txt │ │ │ ├── 0005_escaped_char.graphql │ │ │ ├── 0005_escaped_char.txt │ │ │ ├── 0006_unterminated_string_value_in_list_value_argument.graphql │ │ │ ├── 0006_unterminated_string_value_in_list_value_argument.txt │ │ │ ├── 0007_unterminated_string_value_in_object_value_argument.graphql │ │ │ ├── 0007_unterminated_string_value_in_object_value_argument.txt │ │ │ ├── 0008_unterminated_string_value.graphql │ │ │ ├── 0008_unterminated_string_value.txt │ │ │ ├── 0009_unterminated_string_value_as_default.graphql │ │ │ ├── 0009_unterminated_string_value_as_default.txt │ │ │ ├── 0010_unterminated_string_value_with_unicode.graphql │ │ │ ├── 0010_unterminated_string_value_with_unicode.txt │ │ │ ├── 0011_unterminated_string_value_with_unicode_and_escaped_characters.graphql │ │ │ ├── 0011_unterminated_string_value_with_unicode_and_escaped_characters.txt │ │ │ ├── 0012_string_value_with_line_terminators.graphql │ │ │ ├── 0012_string_value_with_line_terminators.txt │ │ │ ├── 0013_string_with_invalid_escapes.graphql │ │ │ ├── 0013_string_with_invalid_escapes.txt │ │ │ ├── 0014_plus_sign.graphql │ │ │ ├── 0014_plus_sign.txt │ │ │ ├── 0015_minus_sign.graphql │ │ │ ├── 0015_minus_sign.txt │ │ │ ├── 0016_leading_zero.graphql │ │ │ ├── 0016_leading_zero.txt │ │ │ ├── 0017_number_lookahead.graphql │ │ │ ├── 0017_number_lookahead.txt │ │ │ ├── 0018_eof_float_1.graphql │ │ │ ├── 0018_eof_float_1.txt │ │ │ ├── 0019_eof_float_2.graphql │ │ │ ├── 0019_eof_float_2.txt │ │ │ ├── 0020_eof_float_3.graphql │ │ │ ├── 0020_eof_float_3.txt │ │ │ ├── 0021_eof_float_4.graphql │ │ │ ├── 0021_eof_float_4.txt │ │ │ ├── 0022_eof_string_1.graphql │ │ │ ├── 0022_eof_string_1.txt │ │ │ ├── 0023_eof_string_1.graphql │ │ │ ├── 0023_eof_string_1.txt │ │ │ ├── 0024_eof_string_2.graphql │ │ │ ├── 0024_eof_string_2.txt │ │ │ ├── 0025_eof_string_3.graphql │ │ │ ├── 0025_eof_string_3.txt │ │ │ ├── 0026_eof_block_string_1.graphql │ │ │ ├── 0026_eof_block_string_1.txt │ │ │ ├── 0027_eof_block_string_2.graphql │ │ │ ├── 0027_eof_block_string_2.txt │ │ │ ├── 0029_not_whitespace.graphql │ │ │ ├── 0029_not_whitespace.py │ │ │ ├── 0029_not_whitespace.txt │ │ │ ├── 0030_escaped_surrogate.graphql │ │ │ └── 0030_escaped_surrogate.txt │ │ └── ok │ │ │ ├── 0001_hello.graphql │ │ │ ├── 0001_hello.txt │ │ │ ├── 0002_whitespace.graphql │ │ │ ├── 0002_whitespace.txt │ │ │ ├── 0003_name.graphql │ │ │ ├── 0003_name.txt │ │ │ ├── 0004_string_value.graphql │ │ │ ├── 0004_string_value.txt │ │ │ ├── 0005_int.graphql │ │ │ ├── 0005_int.txt │ │ │ ├── 0006_float.graphql │ │ │ ├── 0006_float.txt │ │ │ ├── 0007_symbols.graphql │ │ │ ├── 0007_symbols.txt │ │ │ ├── 0008_block_string.graphql │ │ │ ├── 0008_block_string.txt │ │ │ ├── 0009_block_string_character_with_loose_quotations.graphql │ │ │ ├── 0009_block_string_character_with_loose_quotations.txt │ │ │ ├── 0010_empty_string_value_followed_by_eof.graphql │ │ │ ├── 0010_empty_string_value_followed_by_eof.txt │ │ │ ├── 0011_escaped_char.graphql │ │ │ ├── 0011_escaped_char.txt │ │ │ ├── 0012_unicode_char.graphql │ │ │ ├── 0012_unicode_char.txt │ │ │ ├── 0013_emoji_char_in_string_value.graphql │ │ │ └── 0013_emoji_char_in_string_value.txt │ │ └── parser │ │ ├── err │ │ ├── 0001_directive_definition_missing_location.graphql │ │ ├── 0001_directive_definition_missing_location.txt │ │ ├── 0002_enum_definition_with_missing_name.graphql │ │ ├── 0002_enum_definition_with_missing_name.txt │ │ ├── 0003_enum_definition_with_missing_values.graphql │ │ ├── 0003_enum_definition_with_missing_values.txt │ │ ├── 0004_enum_definition_with_missing_curly.graphql │ │ ├── 0004_enum_definition_with_missing_curly.txt │ │ ├── 0005_enum_extension_with_missing_name.graphql │ │ ├── 0005_enum_extension_with_missing_name.txt │ │ ├── 0006_enum_extension_with_missing_requirements.graphql │ │ ├── 0006_enum_extension_with_missing_requirements.txt │ │ ├── 0007_fragment_definition_with_invalid_fragment_name.graphql │ │ ├── 0007_fragment_definition_with_invalid_fragment_name.txt │ │ ├── 0008_fragment_definition_with_invalid_type_condition.graphql │ │ ├── 0008_fragment_definition_with_invalid_type_condition.txt │ │ ├── 0009_fragment_definition_with_invalid_selection_set.graphql │ │ ├── 0009_fragment_definition_with_invalid_selection_set.txt │ │ ├── 0010_input_definition_with_missing_name.graphql │ │ ├── 0010_input_definition_with_missing_name.txt │ │ ├── 0011_input_definition_with_missing_input_values.graphql │ │ ├── 0011_input_definition_with_missing_input_values.txt │ │ ├── 0012_input_extension_with_missing_name.graphql │ │ ├── 0012_input_extension_with_missing_name.txt │ │ ├── 0013_input_extension_with_missing_requirements.graphql │ │ ├── 0013_input_extension_with_missing_requirements.txt │ │ ├── 0014_interface_extension_with_missing_name.graphql │ │ ├── 0014_interface_extension_with_missing_name.txt │ │ ├── 0015_interface_extension_with_missing_requirements.graphql │ │ ├── 0015_interface_extension_with_missing_requirements.txt │ │ ├── 0016_object_type_extension_with_missing_name.graphql │ │ ├── 0016_object_type_extension_with_missing_name.txt │ │ ├── 0017_object_type_extension_with_missing_requirements.graphql │ │ ├── 0017_object_type_extension_with_missing_requirements.txt │ │ ├── 0018_scalar_definition_with_missing_name.graphql │ │ ├── 0018_scalar_definition_with_missing_name.txt │ │ ├── 0019_scalar_extension_with_missing_name.graphql │ │ ├── 0019_scalar_extension_with_missing_name.txt │ │ ├── 0020_union_definition_with_missing_name.graphql │ │ ├── 0020_union_definition_with_missing_name.txt │ │ ├── 0021_union_definition_with_missing_union_members.graphql │ │ ├── 0021_union_definition_with_missing_union_members.txt │ │ ├── 0022_union_extension_with_missing_name.graphql │ │ ├── 0022_union_extension_with_missing_name.txt │ │ ├── 0023_union_extension_with_missing_requirements.graphql │ │ ├── 0023_union_extension_with_missing_requirements.txt │ │ ├── 0024_document_with_incorrect_definition.graphql │ │ ├── 0024_document_with_incorrect_definition.txt │ │ ├── 0025_document_with_incorrect_definition_and_selection_set.graphql │ │ ├── 0025_document_with_incorrect_definition_and_selection_set.txt │ │ ├── 0026_invalid_definition_squished_between_two_valid_definitions.graphql │ │ ├── 0026_invalid_definition_squished_between_two_valid_definitions.txt │ │ ├── 0027_invalid_type_system_extension.graphql │ │ ├── 0027_invalid_type_system_extension.txt │ │ ├── 0028_invalid_type_system_extension_followed_by_valid.graphql │ │ ├── 0028_invalid_type_system_extension_followed_by_valid.txt │ │ ├── 0029_operation_definition_with_empty_selection_set.graphql │ │ ├── 0029_operation_definition_with_empty_selection_set.txt │ │ ├── 0030_operation_definition_with_description.graphql │ │ ├── 0030_operation_definition_with_description.txt │ │ ├── 0031_argument_with_erronous_string_value.graphql │ │ ├── 0031_argument_with_erronous_string_value.txt │ │ ├── 0032_input_value_with_erronous_string_value.graphql │ │ ├── 0032_input_value_with_erronous_string_value.txt │ │ ├── 0033_directive_with_erronous_string_value.graphql │ │ ├── 0033_directive_with_erronous_string_value.txt │ │ ├── 0034_unterminated_string_value_in_list.graphql │ │ ├── 0034_unterminated_string_value_in_list.txt │ │ ├── 0035_unterminated_string_value_in_object_value.graphql │ │ ├── 0035_unterminated_string_value_in_object_value.txt │ │ ├── 0036_unterminated_string_in_default_value.graphql │ │ ├── 0036_unterminated_string_in_default_value.txt │ │ ├── 0040_operation_definition_missing_selection_set.graphql │ │ ├── 0040_operation_definition_missing_selection_set.txt │ │ ├── 0041_operation_definition_with_missing_selection_set.graphql │ │ ├── 0041_operation_definition_with_missing_selection_set.txt │ │ ├── 0042_document_with_incorrect_token.graphql │ │ ├── 0042_document_with_incorrect_token.txt │ │ ├── 0043_type_with_trailing_garbage.graphql │ │ ├── 0043_type_with_trailing_garbage.txt │ │ ├── 0044_list_type_with_no_type.graphql │ │ ├── 0044_list_type_with_no_type.txt │ │ ├── 0045_ignored_token_spans.graphql │ │ ├── 0045_ignored_token_spans.txt │ │ ├── 0046_incomplete_spreads.graphql │ │ ├── 0046_incomplete_spreads.txt │ │ ├── 0047_empty_variable_definition.graphql │ │ ├── 0047_empty_variable_definition.txt │ │ ├── 0048_unbalanced_list_type_1.graphql │ │ ├── 0048_unbalanced_list_type_1.txt │ │ ├── 0049_unbalanced_list_type_2.graphql │ │ ├── 0049_unbalanced_list_type_2.txt │ │ ├── 0050_invalid_implements_list.graphql │ │ ├── 0050_invalid_implements_list.txt │ │ ├── 0051_union_with_invalid_members_list.graphql │ │ ├── 0051_union_with_invalid_members_list.txt │ │ ├── 0052_const_value.graphql │ │ ├── 0052_const_value.txt │ │ ├── 0053_on_without_type_condition.graphql │ │ ├── 0053_on_without_type_condition.txt │ │ ├── 0054_root_operation_type_with_extra_brackets.graphql │ │ ├── 0054_root_operation_type_with_extra_brackets.txt │ │ ├── 0055_object_definition_with_missing_name.graphql │ │ ├── 0055_object_definition_with_missing_name.txt │ │ ├── 0056_object_definition_with_missing_curly.graphql │ │ ├── 0056_object_definition_with_missing_curly.txt │ │ ├── 0057_object_definition_with_missing_fields.graphql │ │ ├── 0057_object_definition_with_missing_fields.txt │ │ ├── 0058_interface_definition_with_missing_name.graphql │ │ ├── 0058_interface_definition_with_missing_name.txt │ │ ├── 0059_interface_definition_with_missing_fields.graphql │ │ ├── 0059_interface_definition_with_missing_fields.txt │ │ ├── 0060_interface_definition_with_missing_curly.graphql │ │ ├── 0060_interface_definition_with_missing_curly.txt │ │ ├── 0061_empty.graphql │ │ └── 0061_empty.txt │ │ └── ok │ │ ├── 0001_input_type_definition_without_input_values.graphql │ │ ├── 0001_input_type_definition_without_input_values.txt │ │ ├── 0002_selection_simple.graphql │ │ ├── 0002_selection_simple.txt │ │ ├── 0003_selection_with_fields.graphql │ │ ├── 0003_selection_with_fields.txt │ │ ├── 0004_selection_with_fields_aliases_arguments.graphql │ │ ├── 0004_selection_with_fields_aliases_arguments.txt │ │ ├── 0005_selection_with_inline_fragments.graphql │ │ ├── 0005_selection_with_inline_fragments.txt │ │ ├── 0006_selection_with_fragment_spread.graphql │ │ ├── 0006_selection_with_fragment_spread.txt │ │ ├── 0007_directive_definition.graphql │ │ ├── 0007_directive_definition.txt │ │ ├── 0008_directive_definition_with_arguments.graphql │ │ ├── 0008_directive_definition_with_arguments.txt │ │ ├── 0009_directive_definition_repeatable.graphql │ │ ├── 0009_directive_definition_repeatable.txt │ │ ├── 0010_enum_type_definition.graphql │ │ ├── 0010_enum_type_definition.txt │ │ ├── 0011_enum_type_extension.graphql │ │ ├── 0011_enum_type_extension.txt │ │ ├── 0012_fragment_definition.graphql │ │ ├── 0012_fragment_definition.txt │ │ ├── 0013_fragment_definition_with_fragment_spread.graphql │ │ ├── 0013_fragment_definition_with_fragment_spread.txt │ │ ├── 0014_input_definition.graphql │ │ ├── 0014_input_definition.txt │ │ ├── 0015_input_extension.graphql │ │ ├── 0015_input_extension.txt │ │ ├── 0016_interface_definition.graphql │ │ ├── 0016_interface_definition.txt │ │ ├── 0017_interface_extension.graphql │ │ ├── 0017_interface_extension.txt │ │ ├── 0018_object_type_definition.graphql │ │ ├── 0018_object_type_definition.txt │ │ ├── 0019_object_type_extension.graphql │ │ ├── 0019_object_type_extension.txt │ │ ├── 0020_operation_type_definition.graphql │ │ ├── 0020_operation_type_definition.txt │ │ ├── 0021_operation_type_definition_with_arguments.graphql │ │ ├── 0021_operation_type_definition_with_arguments.txt │ │ ├── 0022_operation_type_definition_with_arguments_and_directives.graphql │ │ ├── 0022_operation_type_definition_with_arguments_and_directives.txt │ │ ├── 0023_scalar_definition.graphql │ │ ├── 0023_scalar_definition.txt │ │ ├── 0024_scalar_extension.graphql │ │ ├── 0024_scalar_extension.txt │ │ ├── 0025_schema_definition.graphql │ │ ├── 0025_schema_definition.txt │ │ ├── 0026_schema_extension.graphql │ │ ├── 0026_schema_extension.txt │ │ ├── 0027_union_type_definition.graphql │ │ ├── 0027_union_type_definition.txt │ │ ├── 0028_union_type_definition_followed_by_object_definition.graphql │ │ ├── 0028_union_type_definition_followed_by_object_definition.txt │ │ ├── 0029_union_type_extension.graphql │ │ ├── 0029_union_type_extension.txt │ │ ├── 0030_values.graphql │ │ ├── 0030_values.txt │ │ ├── 0031_variables_with_default.graphql │ │ ├── 0031_variables_with_default.txt │ │ ├── 0032_supergraph.graphql │ │ ├── 0032_supergraph.txt │ │ ├── 0033_directive_on_argument_definition.graphql │ │ ├── 0033_directive_on_argument_definition.txt │ │ ├── 0034_query_shorthand_followed_by_fragment_definition.graphql │ │ ├── 0034_query_shorthand_followed_by_fragment_definition.txt │ │ ├── 0035_query_with_variables.graphql │ │ ├── 0035_query_with_variables.txt │ │ ├── 0036_parses_variable_definition_with_list_type.graphql │ │ ├── 0036_parses_variable_definition_with_list_type.txt │ │ ├── 0037_operation_type_definition_with_inline_fragment.graphql │ │ ├── 0037_operation_type_definition_with_inline_fragment.txt │ │ ├── 0038_wrapped_named_types.graphql │ │ ├── 0038_wrapped_named_types.txt │ │ ├── 0039_variable_with_directives.graphql │ │ ├── 0039_variable_with_directives.txt │ │ ├── 0040_type_token_order.graphql │ │ ├── 0040_type_token_order.txt │ │ ├── 0041_implements_list.graphql │ │ ├── 0041_implements_list.txt │ │ ├── 0042_object_type_definition_without_fields.graphql │ │ ├── 0042_object_type_definition_without_fields.txt │ │ ├── 0043_interface_type_definition_without_fields.graphql │ │ └── 0043_interface_type_definition_without_fields.txt └── apollo-smith │ ├── CHANGELOG.md │ ├── Cargo.toml │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── examples │ ├── generate.rs │ └── schema.graphql │ ├── src │ ├── argument.rs │ ├── description.rs │ ├── directive.rs │ ├── document.rs │ ├── enum_.rs │ ├── field.rs │ ├── fragment.rs │ ├── input_object.rs │ ├── input_value.rs │ ├── interface.rs │ ├── lib.rs │ ├── name.rs │ ├── object.rs │ ├── operation.rs │ ├── scalar.rs │ ├── schema.rs │ ├── selection_set.rs │ ├── snapshot_tests.rs │ ├── ty.rs │ ├── union.rs │ └── variable.rs │ └── tests │ └── with_document.rs ├── examples └── validation-wasm-demo │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ └── src │ └── lib.rs ├── fuzz ├── .gitignore ├── Cargo.toml ├── fuzz_targets │ ├── coordinate.rs │ ├── lexer.rs │ ├── parser.rs │ ├── parser_limited.rs │ ├── reparse.rs │ └── strings.rs └── src │ └── lib.rs ├── graphql.ungram ├── images └── apollo_parser_tree_manipulation.png ├── rustfmt.toml └── xtask ├── Cargo.toml └── src ├── codegen ├── gen_syntax_kinds.rs ├── gen_syntax_nodes.rs └── mod.rs ├── cst_src.rs ├── main.rs └── utils.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | xtask = "run --package xtask --" 3 | 4 | # circle seems to install cargo packages via ssh:// rather than https:// 5 | [net] 6 | git-fetch-with-cli = true 7 | 8 | # WebAssembly support per https://docs.rs/getrandom/0.3.3/getrandom/#opt-in-backends 9 | # See examples/validation-wasm-demo/Cargo.toml 10 | [target.wasm32-unknown-unknown] 11 | rustflags = ['--cfg', 'getrandom_backend="wasm_js"'] 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto eol=lf -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @apollographql/rust-platform 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Docs Issues ✏ 3 | about: Can't find something or notice an error in our docs? Go here! 4 | labels: "documentation, triage" 5 | --- 6 | 7 | 10 | 11 | ## Description 12 | 13 | Describe the issue that you're seeing or the docs you're missing. -------------------------------------------------------------------------------- /.github/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended", 5 | ":preserveSemverRanges", 6 | ], 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | 12 | # ignore IDEA fileas 13 | .idea 14 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = [ 4 | "xtask/", 5 | "crates/apollo-parser", 6 | "crates/apollo-compiler", 7 | "crates/apollo-smith", 8 | "fuzz", 9 | "examples/validation-wasm-demo", 10 | ] 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/apollo-compiler/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/apollo-compiler/benches/testdata/simple_query.graphql: -------------------------------------------------------------------------------- 1 | { cat { name } } 2 | -------------------------------------------------------------------------------- /crates/apollo-compiler/benches/testdata/simple_schema.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | cat: Pet 3 | } 4 | 5 | type Pet { 6 | name: String 7 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/benches/testdata/supergraph_query.graphql: -------------------------------------------------------------------------------- 1 | query Query { 2 | topProducts { 3 | sku 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /crates/apollo-compiler/examples/documents/get_dog_name.graphql: -------------------------------------------------------------------------------- 1 | query getDogName { 2 | dog { 3 | name 4 | } 5 | } 6 | 7 | # duplicate name, should show up in diagnostics 8 | query getDogName { 9 | dog { 10 | owner { 11 | name 12 | } 13 | } 14 | doesNotExist 15 | } 16 | -------------------------------------------------------------------------------- /crates/apollo-compiler/examples/documents/get_dog_with_fragments.graphql: -------------------------------------------------------------------------------- 1 | { 2 | dog { 3 | ...fragmentOne 4 | ...fragmentTwo 5 | } 6 | } 7 | 8 | fragment fragmentOne on Dog { 9 | name 10 | } 11 | 12 | fragment fragmentTwo on Dog { 13 | owner { 14 | name 15 | } 16 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/examples/documents/schema_extension.graphql: -------------------------------------------------------------------------------- 1 | extend type Query { 2 | human: Human 3 | pet: Pet 4 | catOrDog: CatOrDog 5 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/examples/query_with_errors.graphql: -------------------------------------------------------------------------------- 1 | query ExampleQuery($definedVariable: String) { 2 | topProducts(first: $undefinedVariable) { 3 | name 4 | } 5 | } 6 | 7 | fragment vipCustomer on User { 8 | id 9 | name 10 | profilePic(size: 50) 11 | status 12 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/src/execution/mod.rs: -------------------------------------------------------------------------------- 1 | //! APIs related to [executing a GraphQL request][execution] 2 | //! and returning a [GraphQL response][response] 3 | //! 4 | //! [execution]: https://spec.graphql.org/October2021/#sec-Execution 5 | //! [response]: https://spec.graphql.org/October2021/#sec-Response 6 | 7 | #[macro_use] 8 | pub(crate) mod resolver; 9 | pub(crate) mod engine; 10 | pub(crate) mod input_coercion; 11 | pub(crate) mod result_coercion; 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0001_duplicate_operatoin_names.graphql: -------------------------------------------------------------------------------- 1 | query getName { 2 | cat 3 | } 4 | 5 | query getName { 6 | cat 7 | } 8 | 9 | type Query { 10 | cat: String 11 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0001_duplicate_operatoin_names.txt: -------------------------------------------------------------------------------- 1 | Error: the operation `getName` is defined multiple times in the document 2 | ╭─[ 0001_duplicate_operatoin_names.graphql:5:7 ] 3 | │ 4 | 1 │ query getName { 5 | │ ───┬─── 6 | │ ╰───── previous definition of `getName` here 7 | │ 8 | 5 │ query getName { 9 | │ ───┬─── 10 | │ ╰───── `getName` redefined here 11 | ───╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0002_multiple_anonymous_operations.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | cat 3 | } 4 | 5 | mutation { 6 | addPet(name: "Example") { 7 | response 8 | } 9 | } 10 | 11 | type Query { 12 | cat: String 13 | } 14 | 15 | type Mutation { 16 | addPet (name: String!, petType: PetType): Result! 17 | } 18 | 19 | enum PetType { 20 | CAT 21 | DOG 22 | } 23 | 24 | type Result { 25 | pageNumber: Int 26 | response: String 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0003_anonymous_and_named_operation.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | cat 3 | } 4 | 5 | mutation getName { 6 | addPet { 7 | response 8 | } 9 | } 10 | 11 | type Query { 12 | cat: String 13 | } 14 | 15 | type Mutation { 16 | addPet (name: String!, petType: PetType): Result! 17 | } 18 | 19 | enum PetType { 20 | CAT 21 | DOG 22 | } 23 | 24 | type Result { 25 | pageNumber: Int 26 | response: String 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0004_subscription_with_multiple_root_fields.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | newMessage { 3 | body 4 | sender 5 | } 6 | disallowedSecondRootField 7 | } 8 | 9 | type Subscription { 10 | newMessage: Result 11 | disallowedSecondRootField: String 12 | } 13 | 14 | type Result { 15 | body: String, 16 | sender: String 17 | } 18 | 19 | type Query { 20 | message: String 21 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0004_subscription_with_multiple_root_fields.txt: -------------------------------------------------------------------------------- 1 | Error: subscription `sub` can only have one root field 2 | ╭─[ 0004_subscription_with_multiple_root_fields.graphql:1:1 ] 3 | │ 4 | 1 │ ╭─▶ subscription sub { 5 | ┆ ┆ 6 | 7 │ ├─▶ } 7 | │ │ 8 | │ ╰─────── subscription with 2 root fields 9 | │ 10 | │ Help: There are 2 root fields: newMessage, disallowedSecondRootField. This is not allowed. 11 | ───╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0005_subscription_with_multiple_root_fields_in_fragment_spreads.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | ...multipleSubscriptions 3 | } 4 | 5 | fragment multipleSubscriptions on Subscription { 6 | newMessage { 7 | body 8 | sender 9 | } 10 | disallowedSecondRootField 11 | } 12 | 13 | type Subscription { 14 | newMessage: Result 15 | disallowedSecondRootField: String 16 | } 17 | 18 | type Result { 19 | body: String, 20 | sender: String 21 | } 22 | 23 | type Query { 24 | message: String 25 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0005_subscription_with_multiple_root_fields_in_fragment_spreads.txt: -------------------------------------------------------------------------------- 1 | Error: subscription `sub` can only have one root field 2 | ╭─[ 0005_subscription_with_multiple_root_fields_in_fragment_spreads.graphql:1:1 ] 3 | │ 4 | 1 │ ╭─▶ subscription sub { 5 | ┆ ┆ 6 | 3 │ ├─▶ } 7 | │ │ 8 | │ ╰─────── subscription with 2 root fields 9 | │ 10 | │ Help: There are 2 root fields: newMessage, disallowedSecondRootField. This is not allowed. 11 | ───╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0006_subscription_with_multiple_root_fields_in_inline_fragments.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | ... on Subscription { 3 | newMessage { 4 | body 5 | sender 6 | } 7 | disallowedSecondRootField 8 | } 9 | } 10 | 11 | type Subscription { 12 | newMessage: Result 13 | disallowedSecondRootField: String 14 | } 15 | 16 | type Result { 17 | body: String, 18 | sender: String 19 | } 20 | 21 | type Query { 22 | message: String 23 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0006_subscription_with_multiple_root_fields_in_inline_fragments.txt: -------------------------------------------------------------------------------- 1 | Error: subscription `sub` can only have one root field 2 | ╭─[ 0006_subscription_with_multiple_root_fields_in_inline_fragments.graphql:1:1 ] 3 | │ 4 | 1 │ ╭─▶ subscription sub { 5 | ┆ ┆ 6 | 9 │ ├─▶ } 7 | │ │ 8 | │ ╰─────── subscription with 2 root fields 9 | │ 10 | │ Help: There are 2 root fields: newMessage, disallowedSecondRootField. This is not allowed. 11 | ───╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0007_operation_with_undefined_variables.graphql: -------------------------------------------------------------------------------- 1 | query ExampleQuery { 2 | topProducts( 3 | first: $undefinedVariable 4 | filter: { 5 | offset: $offset 6 | keywords: ["a", $keyword] 7 | } 8 | ) { 9 | name 10 | } 11 | } 12 | 13 | input Filter { 14 | keywords: [String!] 15 | offset: Int 16 | limit: Int 17 | } 18 | 19 | type Query { 20 | topProducts(first: Int, filter: Filter): Product, 21 | } 22 | 23 | type Product { 24 | name: String 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0008_operation_with_undefined_variables_in_inline_fragment.graphql: -------------------------------------------------------------------------------- 1 | query ExampleQuery { 2 | topProducts { 3 | name 4 | ... on Product { 5 | price(setPrice: $value) 6 | } 7 | } 8 | } 9 | 10 | type Query { 11 | topProducts(first: Int): Product, 12 | } 13 | 14 | type Product { 15 | name: String 16 | price(setPrice: Int): Int 17 | } 18 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0008_operation_with_undefined_variables_in_inline_fragment.txt: -------------------------------------------------------------------------------- 1 | Error: variable `$value` is not defined 2 | ╭─[ 0008_operation_with_undefined_variables_in_inline_fragment.graphql:5:25 ] 3 | │ 4 | 5 │ price(setPrice: $value) 5 | │ ───┬── 6 | │ ╰──── not found in this scope 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0010_operation_with_unused_variable.graphql: -------------------------------------------------------------------------------- 1 | query ExampleQuery($unusedVariable: Int) { 2 | topProducts { 3 | name 4 | } 5 | } 6 | 7 | type Query { 8 | topProducts(first: Int): Product, 9 | } 10 | 11 | type Product { 12 | name: String 13 | price(setPrice: Int): Int 14 | } 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0010_operation_with_unused_variable.txt: -------------------------------------------------------------------------------- 1 | Error: unused variable: `$unusedVariable` 2 | ╭─[ 0010_operation_with_unused_variable.graphql:1:20 ] 3 | │ 4 | 1 │ query ExampleQuery($unusedVariable: Int) { 5 | │ ───────┬─────── 6 | │ ╰───────── variable is never used 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0011_syntactic_errors_from_parser.graphql: -------------------------------------------------------------------------------- 1 | query getName {} 2 | 3 | type Query { 4 | topProducts(first: Int): Product, 5 | } 6 | 7 | type Product { 8 | name: String 9 | birthday: String 10 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0011_syntactic_errors_from_parser.txt: -------------------------------------------------------------------------------- 1 | Error: syntax error: expected at least one Selection in Selection Set 2 | ╭─[ 0011_syntactic_errors_from_parser.graphql:1:16 ] 3 | │ 4 | 1 │ query getName {} 5 | │ ┬ 6 | │ ╰── expected at least one Selection in Selection Set 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0012_schema_definition_with_missing_query_operation_type.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | subscription: customSubscription 3 | } 4 | 5 | type customSubscription { 6 | changeInPetHousehold: Result 7 | } 8 | 9 | type Result { 10 | id: String 11 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0012_schema_definition_with_missing_query_operation_type.txt: -------------------------------------------------------------------------------- 1 | Error: missing query root operation type in schema definition 2 | ╭─[ 0012_schema_definition_with_missing_query_operation_type.graphql:1:1 ] 3 | │ 4 | 1 │ ╭─▶ schema { 5 | ┆ ┆ 6 | 3 │ ├─▶ } 7 | │ │ 8 | │ ╰─────── `query` root operation type must be defined here 9 | ───╯ 10 | 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0013_schema_definition_with_duplicate_root_type_operations.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: customPetQuery 3 | query: thatOtherQuery 4 | } 5 | 6 | type customPetQuery { 7 | name: String 8 | } 9 | type thatOtherQuery { 10 | age: Int 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0013_schema_definition_with_duplicate_root_type_operations.txt: -------------------------------------------------------------------------------- 1 | Error: duplicate definitions for the `query` root operation type 2 | ╭─[ 0013_schema_definition_with_duplicate_root_type_operations.graphql:3:3 ] 3 | │ 4 | 2 │ query: customPetQuery 5 | │ ───────┬────── 6 | │ ╰──────── previous definition of `query` here 7 | 3 │ query: thatOtherQuery 8 | │ ──────────┬────────── 9 | │ ╰──────────── `query` redefined here 10 | ───╯ 11 | 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0014_subscription_operation_without_subscription_schema_operation_type.graphql: -------------------------------------------------------------------------------- 1 | subscription messageSubscription { 2 | newMessage { 3 | body 4 | sender 5 | } 6 | } 7 | 8 | schema { 9 | query: customPetQuery, 10 | } 11 | 12 | type customPetQuery { 13 | name: String, 14 | newMessage: Message 15 | age: Int 16 | } 17 | 18 | type Message { 19 | body: String 20 | sender: String 21 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0015_mutation_operation_without_mutation_schema_definition.graphql: -------------------------------------------------------------------------------- 1 | mutation adoptAPetMutation { 2 | addPet { 3 | owner { 4 | name 5 | } 6 | } 7 | } 8 | 9 | type Query { 10 | name: String, 11 | age: Int 12 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0015_mutation_operation_without_mutation_schema_definition.txt: -------------------------------------------------------------------------------- 1 | Error: `mutation` root operation type is not defined 2 | ╭─[ 0015_mutation_operation_without_mutation_schema_definition.graphql:1:1 ] 3 | │ 4 | 1 │ ╭─▶ mutation adoptAPetMutation { 5 | ┆ ┆ 6 | 7 │ ├─▶ } 7 | │ │ 8 | │ ╰─────── `mutation` is not defined in the schema and is therefore not supported 9 | │ 10 | │ Help: consider defining a `mutation` root operation type in your schema 11 | ───╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0016_schema_with_built_in_scalar_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | amount: Int 3 | } 4 | 5 | scalar Int 6 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0016_schema_with_built_in_scalar_definition.txt: -------------------------------------------------------------------------------- 1 | Error: built-in scalar definitions must be omitted 2 | ╭─[ 0016_schema_with_built_in_scalar_definition.graphql:5:1 ] 3 | │ 4 | 5 │ scalar Int 5 | │ ─────┬──── 6 | │ ╰────── remove this scalar definition 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0017_schema_with_unspecified_scalar.graphql: -------------------------------------------------------------------------------- 1 | # Placeholder for removed test, to avoid renumbering 2 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0017_schema_with_unspecified_scalar.txt: -------------------------------------------------------------------------------- 1 | Error: missing query root operation type in schema definition 2 | Error: syntax error: Unexpected . 3 | ╭─[ 0017_schema_with_unspecified_scalar.graphql:1:54 ] 4 | │ 5 | 1 │ # Placeholder for removed test, to avoid renumbering 6 | │ │ 7 | │ ╰─ Unexpected . 8 | ───╯ 9 | 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0018_schema_with_specified_scalar_missing_values.graphql: -------------------------------------------------------------------------------- 1 | # Placeholder for removed test, to avoid renumbering 2 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0018_schema_with_specified_scalar_missing_values.txt: -------------------------------------------------------------------------------- 1 | Error: missing query root operation type in schema definition 2 | Error: syntax error: Unexpected . 3 | ╭─[ 0018_schema_with_specified_scalar_missing_values.graphql:1:54 ] 4 | │ 5 | 1 │ # Placeholder for removed test, to avoid renumbering 6 | │ │ 7 | │ ╰─ Unexpected . 8 | ───╯ 9 | 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0019_enum_definition_with_duplicate_values.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Pet, 3 | snacks: Snack, 4 | } 5 | 6 | enum Pet { 7 | CAT 8 | DOG 9 | FOX 10 | CAT 11 | } 12 | 13 | enum Snack { 14 | THRIVE_PET_FOODS 15 | LILYS_KITCHEN 16 | ACANA 17 | THRIVE_PET_FOODS 18 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0020_enum_values_with_uncapitalised_values.graphql: -------------------------------------------------------------------------------- 1 | # Placeholder for removed test, to avoid renumbering 2 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0020_enum_values_with_uncapitalised_values.txt: -------------------------------------------------------------------------------- 1 | Error: missing query root operation type in schema definition 2 | Error: syntax error: Unexpected . 3 | ╭─[ 0020_enum_values_with_uncapitalised_values.graphql:1:54 ] 4 | │ 5 | 1 │ # Placeholder for removed test, to avoid renumbering 6 | │ │ 7 | │ ╰─ Unexpected . 8 | ───╯ 9 | 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0021_union_definition_with_duplicate_members.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: SearchQuery 3 | } 4 | 5 | union SearchResult = Photo | Photo 6 | 7 | type Person { 8 | name: String 9 | age: Int 10 | } 11 | 12 | type Photo { 13 | height: Int 14 | width: Int 15 | } 16 | 17 | type SearchQuery { 18 | firstSearchResult: SearchResult 19 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0021_union_definition_with_duplicate_members.txt: -------------------------------------------------------------------------------- 1 | Error: duplicate definitions for the `Photo` member of union type `SearchResult` 2 | ╭─[ 0021_union_definition_with_duplicate_members.graphql:5:30 ] 3 | │ 4 | 5 │ union SearchResult = Photo | Photo 5 | │ ──┬── ──┬── 6 | │ ╰──────────── previous definition of `Photo` here 7 | │ │ 8 | │ ╰──── `Photo` redefined here 9 | ───╯ 10 | 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0022_duplicate_interface_definitions.graphql: -------------------------------------------------------------------------------- 1 | type Query implements NamedEntity { 2 | name: String 3 | } 4 | 5 | interface NamedEntity { 6 | name: String 7 | } 8 | 9 | interface NamedEntity { 10 | name: String 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0023_interface_definition_with_cyclic_implements_interfaces.graphql: -------------------------------------------------------------------------------- 1 | type Query implements NamedEntity { 2 | name: String 3 | } 4 | 5 | interface NamedEntity implements NamedEntity { 6 | name: String 7 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0023_interface_definition_with_cyclic_implements_interfaces.txt: -------------------------------------------------------------------------------- 1 | Error: interface NamedEntity cannot implement itself 2 | ╭─[ 0023_interface_definition_with_cyclic_implements_interfaces.graphql:5:34 ] 3 | │ 4 | 5 │ interface NamedEntity implements NamedEntity { 5 | │ ─────┬───── 6 | │ ╰─────── interface NamedEntity cannot implement itself 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0024_interface_definition_with_duplicate_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query implements NamedEntity { 2 | name: String 3 | } 4 | 5 | interface NamedEntity { 6 | name: String 7 | name: String 8 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0024_interface_definition_with_duplicate_fields.txt: -------------------------------------------------------------------------------- 1 | Error: duplicate definitions for the `name` field of interface type `NamedEntity` 2 | ╭─[ 0024_interface_definition_with_duplicate_fields.graphql:7:3 ] 3 | │ 4 | 6 │ name: String 5 | │ ──┬─ 6 | │ ╰─── previous definition of `name` here 7 | 7 │ name: String 8 | │ ──────┬───── 9 | │ ╰─────── `name` redefined here 10 | ───╯ 11 | 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0025_interface_definition_with_missing_transitive_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node { 2 | id: ID! 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource implements Node { 10 | id: ID! 11 | width: Int 12 | } 13 | 14 | interface Image implements Resource & Node { 15 | id: ID! 16 | thumbnail: String 17 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0026_interface_definition_with_missing_implemetns_interface.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node { 2 | id: ID! 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource implements Node { 10 | id: ID! 11 | url: String 12 | width: Int 13 | } 14 | 15 | interface Image implements Resource { 16 | id: ID! 17 | url: String 18 | width: Int 19 | thumbnail: String 20 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0027_interface_definition_with_undefined_implements_interface.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Resource { 2 | id: ID! 3 | width: Int 4 | } 5 | 6 | interface Resource { 7 | id: ID! 8 | width: Int 9 | } 10 | 11 | interface Image implements Resource & Url { 12 | id: ID! 13 | url: String 14 | width: Int 15 | thumbnail: String 16 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0027_interface_definition_with_undefined_implements_interface.txt: -------------------------------------------------------------------------------- 1 | Error: cannot find type `Url` in this document 2 | ╭─[ 0027_interface_definition_with_undefined_implements_interface.graphql:11:39 ] 3 | │ 4 | 11 │ interface Image implements Resource & Url { 5 | │ ─┬─ 6 | │ ╰─── not found in this scope 7 | ────╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0028_interface_definition_with_missing_fields_implements_intrefaces_undefined_interfaces.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node { 2 | id: ID! 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource implements Node { 10 | id: ID! 11 | width: Int 12 | } 13 | 14 | interface Image implements Resource & Url{ 15 | id: ID! 16 | thumbnail: String 17 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0029_directive_definitions_with_duplicate_names.graphql: -------------------------------------------------------------------------------- 1 | schema @foo { 2 | query: Query 3 | } 4 | 5 | type Query { 6 | id: ID! 7 | field: String 8 | } 9 | 10 | directive @foo on SCHEMA 11 | directive @foo on SCHEMA -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0030_schema_with_duplicate_input_objects.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | website: URL, 3 | amount: Int 4 | } 5 | 6 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 7 | 8 | input Point2D { 9 | x: Float 10 | y: Float 11 | } 12 | 13 | input Point2D { 14 | x: Float 15 | y: Float 16 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0030_schema_with_duplicate_input_objects.txt: -------------------------------------------------------------------------------- 1 | Error: the type `Point2D` is defined multiple times in the schema 2 | ╭─[ 0030_schema_with_duplicate_input_objects.graphql:13:7 ] 3 | │ 4 | 8 │ input Point2D { 5 | │ ───┬─── 6 | │ ╰───── previous definition of `Point2D` here 7 | │ 8 | 13 │ input Point2D { 9 | │ ───┬─── 10 | │ ╰───── `Point2D` redefined here 11 | │ 12 | │ Help: remove or rename one of the definitions, or use `extend` 13 | ────╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0031_input_object_with_duplicate_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | website: URL, 3 | amount: Int 4 | } 5 | 6 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 7 | 8 | input Point2D { 9 | x: Float 10 | x: Float 11 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0031_input_object_with_duplicate_fields.txt: -------------------------------------------------------------------------------- 1 | Error: duplicate definitions for the `x` field of input object type `Point2D` 2 | ╭─[ 0031_input_object_with_duplicate_fields.graphql:10:3 ] 3 | │ 4 | 9 │ x: Float 5 | │ ┬ 6 | │ ╰── previous definition of `x` here 7 | 10 │ x: Float 8 | │ ────┬─── 9 | │ ╰───── `x` redefined here 10 | ────╯ 11 | 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0032_duplicate_object_type_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | 5 | type Query { 6 | name: String 7 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0032_duplicate_object_type_definition.txt: -------------------------------------------------------------------------------- 1 | Error: the type `Query` is defined multiple times in the schema 2 | ╭─[ 0032_duplicate_object_type_definition.graphql:5:6 ] 3 | │ 4 | 1 │ type Query { 5 | │ ──┬── 6 | │ ╰──── previous definition of `Query` here 7 | │ 8 | 5 │ type Query { 9 | │ ──┬── 10 | │ ╰──── `Query` redefined here 11 | │ 12 | │ Help: remove or rename one of the definitions, or use `extend` 13 | ───╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0033_object_type_definition_with_duplicate_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | name: String 4 | } 5 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0033_object_type_definition_with_duplicate_fields.txt: -------------------------------------------------------------------------------- 1 | Error: duplicate definitions for the `name` field of object type `Query` 2 | ╭─[ 0033_object_type_definition_with_duplicate_fields.graphql:3:3 ] 3 | │ 4 | 2 │ name: String 5 | │ ──┬─ 6 | │ ╰─── previous definition of `name` here 7 | 3 │ name: String 8 | │ ──────┬───── 9 | │ ╰─────── `name` redefined here 10 | ───╯ 11 | 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0034_object_type_definition_with_missing_transitive_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node & Resource { 2 | name: String 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource { 10 | width: Int 11 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0035_object_type_definition_with_missing_implements_interfaces_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Image { 2 | name: String 3 | id: ID! 4 | url: String 5 | width: Int 6 | thumbnail: String 7 | } 8 | 9 | interface Node { 10 | id: ID! 11 | } 12 | 13 | interface Resource implements Node { 14 | id: ID! 15 | url: String 16 | width: Int 17 | } 18 | 19 | interface Image implements Resource { 20 | id: ID! 21 | url: String 22 | width: Int 23 | thumbnail: String 24 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0038_object_type_with_undefined_field_type.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | width: Int 3 | img: Url 4 | relationship: Person 5 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0039_interface_with_undefined_field_type.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | width: Int 3 | img: Url 4 | } 5 | 6 | interface Connection { 7 | relationship: Person 8 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0041_subscription_operation_with_undefined_fields.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | undefinedSubscriptionField 3 | } 4 | 5 | type Subscription { 6 | newMessage: Result 7 | } 8 | 9 | type Result { 10 | body: String, 11 | sender: String 12 | } 13 | 14 | type Query { 15 | message: String 16 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0042_mutation_operation_with_undefined_fields.graphql: -------------------------------------------------------------------------------- 1 | mutation adoptAPetMutation { 2 | undefinedMutationField 3 | } 4 | 5 | type Query { 6 | name: String, 7 | age: Int 8 | } 9 | 10 | type Mutation { 11 | addPet (name: String!, petType: PetType): Result! 12 | } 13 | 14 | type Result { 15 | id: String 16 | } 17 | 18 | enum PetType { 19 | CAT 20 | DOG 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0043_undefined_union_member.graphql: -------------------------------------------------------------------------------- 1 | interface Pet { 2 | name: String 3 | } 4 | 5 | type Dog implements Pet { 6 | name: String 7 | nickname: String 8 | barkVolume: Int 9 | } 10 | 11 | union CatOrDog = Cat | Dog 12 | 13 | type Human { 14 | name: String 15 | pets: [Pet] 16 | } 17 | 18 | type Query { 19 | human: Human 20 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0043_undefined_union_member.txt: -------------------------------------------------------------------------------- 1 | Error: cannot find type `Cat` in this document 2 | ╭─[ 0043_undefined_union_member.graphql:11:18 ] 3 | │ 4 | 11 │ union CatOrDog = Cat | Dog 5 | │ ─┬─ 6 | │ ╰─── not found in this scope 7 | ────╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0044_union_member_not_of_object_type.graphql: -------------------------------------------------------------------------------- 1 | interface Pet { 2 | name: String 3 | } 4 | 5 | type Cat implements Pet { 6 | name: String 7 | nickname: String 8 | meowVolume: Int 9 | } 10 | 11 | type Dog implements Pet { 12 | name: String 13 | nickname: String 14 | barkVolume: Int 15 | } 16 | 17 | union CatOrDog = Cat | Pet 18 | 19 | type Human { 20 | name: String 21 | pets: [Pet] 22 | } 23 | 24 | type Query { 25 | human: Human 26 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0044_union_member_not_of_object_type.txt: -------------------------------------------------------------------------------- 1 | Error: union member `Pet` must be an object type 2 | ╭─[ 0044_union_member_not_of_object_type.graphql:17:24 ] 3 | │ 4 | 17 │ union CatOrDog = Cat | Pet 5 | │ ─┬─ 6 | │ ╰─── this is an interface type 7 | │ 8 | │ Help: Union members must be object types. 9 | ────╯ 10 | 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0046_duplicate_directive_arguments.graphql: -------------------------------------------------------------------------------- 1 | scalar newScalar @specifiedBy(url: "https://tools.ietf.org/html/rfc4122", url: "https://tools.ietf.org/html/rfc4125") 2 | 3 | type Query { 4 | status: String, 5 | response: String @example(if: false, if: true) 6 | } 7 | 8 | directive @example(if: Boolean) on FIELD_DEFINITION -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0047_duplicate_field_arguments.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | single(arg: Boolean): Int 3 | } 4 | query GetDuplicate { 5 | single(arg: true, arg: false) 6 | } 7 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0047_duplicate_field_arguments.txt: -------------------------------------------------------------------------------- 1 | Error: the argument `arg` is provided multiple times 2 | ╭─[ 0047_duplicate_field_arguments.graphql:5:21 ] 3 | │ 4 | 5 │ single(arg: true, arg: false) 5 | │ ────┬──── ─────┬──── 6 | │ ╰────────────────── previously provided `arg` here 7 | │ │ 8 | │ ╰────── `arg` provided again here 9 | │ 10 | │ Help: `arg` argument must only be provided once. 11 | ───╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0048_duplicate_field_argument_definition_names.graphql: -------------------------------------------------------------------------------- 1 | interface Duplicate { 2 | duplicate(arg: Boolean, arg: Boolean): Int 3 | } 4 | 5 | type Query implements Duplicate { 6 | single(arg: Boolean): Int 7 | duplicate(arg: Boolean, arg: Boolean): Int 8 | } 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0049_duplicate_directive_argument_definition_names.graphql: -------------------------------------------------------------------------------- 1 | directive @example(arg: Boolean, arg: Boolean) on FIELD 2 | type Query { 3 | x: Int 4 | } 5 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0051_subscription_operation_with_root_introspection_field.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | __typename 3 | } 4 | 5 | type Subscription { 6 | __typename: String 7 | } 8 | 9 | type Query { 10 | x: Int 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0052_undefined_directive.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | status: Int @directiveA 4 | } 5 | 6 | directive @directiveB on FIELD_DEFINITION 7 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0052_undefined_directive.txt: -------------------------------------------------------------------------------- 1 | Error: cannot find directive `@directiveA` in this document 2 | ╭─[ 0052_undefined_directive.graphql:3:17 ] 3 | │ 4 | 3 │ status: Int @directiveA 5 | │ ─────┬───── 6 | │ ╰─────── directive not defined 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0053_argument_name_is_not_defined.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | field(arg1: Int): Int 3 | item: Field 4 | } 5 | 6 | type Field { 7 | field(arg4: Int): Int 8 | } 9 | 10 | fragment X on Field { 11 | field(arg4: 1, arg2: 2, arg3: 3) 12 | } 13 | 14 | query field { 15 | field(arg2: 3) 16 | } 17 | 18 | query fieldWithFragment { 19 | item { 20 | ...X 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0055_duplicate_variable_definitions.graphql: -------------------------------------------------------------------------------- 1 | query houseTrainedQuery($atOtherHomes: Boolean, $atOtherHomes: Boolean) { 2 | dog { 3 | isHouseTrained(atOtherHomes: $atOtherHomes) 4 | } 5 | } 6 | 7 | type Query { 8 | dog: Dog 9 | } 10 | 11 | type Dog { 12 | name: String! 13 | nickname: String 14 | barkVolume: Int 15 | isHouseTrained(atOtherHomes: Boolean): Boolean! 16 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0057_duplicate_type_names.graphql: -------------------------------------------------------------------------------- 1 | interface World { 2 | a: Int 3 | } 4 | type Object implements World { 5 | a: Int 6 | } 7 | 8 | # not OK 9 | type World implements World { 10 | a: Int 11 | } 12 | 13 | # OK 14 | scalar X @specifiedBy(url: "https://apollographql.com") 15 | # not OK 16 | union X @X = Object 17 | # not OK 18 | enum X { Y, Z } 19 | 20 | type X { 21 | x: X 22 | } 23 | 24 | directive @X(ok: Boolean) on UNION 25 | 26 | type Query { 27 | x: Int 28 | } 29 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0058_fragment_definitions_with_duplicate_names.graphql: -------------------------------------------------------------------------------- 1 | # https://github.com/apollographql/apollo-rs/issues/457 2 | type Query { 3 | pet: Pet 4 | } 5 | type Pet { 6 | name: String! 7 | owner: String 8 | } 9 | 10 | query getPet { 11 | pet { 12 | name 13 | ... petFragment 14 | } 15 | } 16 | 17 | fragment petFragment on Pet { 18 | name 19 | owner 20 | } 21 | 22 | fragment petFragment on Pet { 23 | name 24 | owner 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0058_fragment_definitions_with_duplicate_names.txt: -------------------------------------------------------------------------------- 1 | Error: the fragment `petFragment` is defined multiple times in the document 2 | ╭─[ 0058_fragment_definitions_with_duplicate_names.graphql:22:10 ] 3 | │ 4 | 17 │ fragment petFragment on Pet { 5 | │ ─────┬───── 6 | │ ╰─────── previous definition of `petFragment` here 7 | │ 8 | 22 │ fragment petFragment on Pet { 9 | │ ─────┬───── 10 | │ ╰─────── `petFragment` redefined here 11 | ────╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0059_root_operation_object_type.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: SomeInterface 3 | } 4 | 5 | interface SomeInterface { 6 | name: String 7 | } 8 | 9 | type ShouldBeTheQuery { 10 | name: String 11 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0059_root_operation_object_type.txt: -------------------------------------------------------------------------------- 1 | Error: `SomeInterface` field must return an object type 2 | ╭─[ 0059_root_operation_object_type.graphql:2:12 ] 3 | │ 4 | 2 │ query: SomeInterface 5 | │ ──────┬────── 6 | │ ╰──────── this is an interface type 7 | │ 8 | │ Help: Root operation type must be an object type. 9 | ───╯ 10 | 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0060_root_operation_definition_undefined_operation_type.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: SomeQuery 3 | } 4 | 5 | type ShouldBeTheQuery { 6 | name: String 7 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0060_root_operation_definition_undefined_operation_type.txt: -------------------------------------------------------------------------------- 1 | Error: cannot find type `SomeQuery` in this document 2 | ╭─[ 0060_root_operation_definition_undefined_operation_type.graphql:2:12 ] 3 | │ 4 | 2 │ query: SomeQuery 5 | │ ────┬──── 6 | │ ╰────── not found in this scope 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0061_root_operation_with_default_undefined_query.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: Query 3 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0061_root_operation_with_default_undefined_query.txt: -------------------------------------------------------------------------------- 1 | Error: cannot find type `Query` in this document 2 | ╭─[ 0061_root_operation_with_default_undefined_query.graphql:2:12 ] 3 | │ 4 | 2 │ query: Query 5 | │ ──┬── 6 | │ ╰──── not found in this scope 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0062_root_operation_with_list.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: [Object] 3 | } 4 | type Object { 5 | field: Int 6 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0063_extension_orphan.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | x: Int 3 | } 4 | 5 | extend scalar A @deprecated(reason: "Use B instead") 6 | extend type B { field: Int! } 7 | extend schema { 8 | query: Query 9 | } 10 | extend union C = String 11 | extend interface D { 12 | field: Int 13 | } 14 | extend input E { 15 | field: Int 16 | } 17 | extend enum F { 18 | MEMBER 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0065_subselection_of_enum.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfEnum { 2 | pet1 { name } 3 | pet2 { name } 4 | pet3 { name } 5 | pet4 { name } 6 | pet5 { name } 7 | pet6 { name } 8 | } 9 | 10 | type Query { 11 | pet1: Pet, 12 | pet2: Pet!, 13 | pet3: [Pet], 14 | pet4: [Pet!], 15 | pet5: [Pet]!, 16 | pet6: [Pet!]!, 17 | } 18 | 19 | enum Pet { 20 | CAT 21 | DOG 22 | FOX 23 | } 24 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0066_subselection_of_scalar.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfScalar { 2 | url1 { name } 3 | url2 { name } 4 | url3 { name } 5 | url4 { name } 6 | url5 { name } 7 | url6 { name } 8 | } 9 | 10 | type Query { 11 | url1: URL, 12 | url2: URL!, 13 | url3: [URL], 14 | url4: [URL!], 15 | url5: [URL]!, 16 | url6: [URL!]!, 17 | } 18 | 19 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0067_subselection_of_interface.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfInterface { 2 | pet1 3 | pet2 4 | pet3 5 | pet4 6 | pet5 7 | pet6 8 | } 9 | 10 | type Query { 11 | pet1: Pet, 12 | pet2: Pet!, 13 | pet3: [Pet], 14 | pet4: [Pet!], 15 | pet5: [Pet]!, 16 | pet6: [Pet!]!, 17 | } 18 | 19 | interface Pet { 20 | id: String, 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0068_subselection_of_union.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfUnion { 2 | pet1 3 | pet2 4 | pet3 5 | pet4 6 | pet5 7 | pet6 8 | } 9 | 10 | type Query { 11 | pet1: CatOrDog, 12 | pet2: CatOrDog!, 13 | pet3: [CatOrDog], 14 | pet4: [CatOrDog!], 15 | pet5: [CatOrDog]!, 16 | pet6: [CatOrDog!]!, 17 | } 18 | 19 | type Cat { id: String! } 20 | type Dog { id: String! } 21 | union CatOrDog = Cat | Dog 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0069_subselection_of_object.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfObject { 2 | pet1 3 | pet2 4 | pet3 5 | pet4 6 | pet5 7 | pet6 8 | } 9 | 10 | type Query { 11 | pet1: Pet, 12 | pet2: Pet!, 13 | pet3: [Pet], 14 | pet4: [Pet!], 15 | pet5: [Pet]!, 16 | pet6: [Pet!]!, 17 | } 18 | 19 | type Pet { 20 | id: String, 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0074_merge_identical_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Dog 3 | } 4 | 5 | type Dog { 6 | nickname: String 7 | name: String! 8 | } 9 | 10 | query queryPupper { 11 | pet { 12 | ...conflictingBecauseAlias 13 | ...sameAliasesWithDifferentFieldTargets 14 | } 15 | } 16 | 17 | fragment conflictingBecauseAlias on Dog { 18 | name: nickname 19 | name 20 | } 21 | 22 | fragment sameAliasesWithDifferentFieldTargets on Dog { 23 | fido: name 24 | fido: nickname 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0077_merge_conflict_deep.graphql: -------------------------------------------------------------------------------- 1 | type O { 2 | a: Int 3 | b: Int 4 | } 5 | type Query { 6 | field: O, 7 | } 8 | 9 | { 10 | field { 11 | x: a 12 | }, 13 | field { 14 | x: b 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0077_merge_conflict_deep.txt: -------------------------------------------------------------------------------- 1 | Error: cannot select different fields into the same alias `x` 2 | ╭─[ 0077_merge_conflict_deep.graphql:14:5 ] 3 | │ 4 | 11 │ x: a 5 | │ ──┬─ 6 | │ ╰─── `x` is selected from `O.a` here 7 | │ 8 | 14 │ x: b 9 | │ ──┬─ 10 | │ ╰─── `x` is selected from `O.b` here 11 | │ 12 | │ Help: Both fields may be present on the schema type, so it's not clear which one should be used to fill the response 13 | ────╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0078_merge_conflict_nested_fragments.graphql: -------------------------------------------------------------------------------- 1 | type T { 2 | a: Int 3 | b: Int 4 | c: Int 5 | d: Int 6 | } 7 | 8 | type Query { 9 | field: T 10 | } 11 | 12 | { 13 | field { 14 | ...F 15 | } 16 | field { 17 | ...I 18 | } 19 | } 20 | fragment F on T { 21 | x: a 22 | ...G 23 | } 24 | fragment G on T { 25 | y: c 26 | } 27 | fragment I on T { 28 | y: d 29 | ...J 30 | } 31 | fragment J on T { 32 | x: b 33 | } 34 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0079_directive_is_unique.graphql: -------------------------------------------------------------------------------- 1 | directive @repeatable repeatable on FIELD 2 | directive @unique on FIELD 3 | 4 | type Query { 5 | fieldA: Int 6 | fieldB: Int 7 | } 8 | 9 | query { 10 | fieldA @repeatable @repeatable 11 | fieldB @unique @unique 12 | } 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0079_directive_is_unique.txt: -------------------------------------------------------------------------------- 1 | Error: non-repeatable directive unique can only be used once per location 2 | ╭─[ 0079_directive_is_unique.graphql:11:18 ] 3 | │ 4 | 11 │ fieldB @unique @unique 5 | │ ───┬─── ───┬─── 6 | │ ╰───────────── directive `@unique` first called here 7 | │ │ 8 | │ ╰───── directive `@unique` called again here 9 | ────╯ 10 | 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0080_directive_is_unique_with_extensions.graphql: -------------------------------------------------------------------------------- 1 | directive @nonRepeatable on OBJECT | SCALAR | INTERFACE 2 | extend type TestObject @nonRepeatable 3 | type TestObject @nonRepeatable { 4 | field: String 5 | } 6 | extend type TestObject @nonRepeatable 7 | 8 | scalar Scalar @nonRepeatable 9 | extend scalar Scalar @nonRepeatable @specifiedBy(url: "example.com") 10 | 11 | interface Intf @nonRepeatable { 12 | field: String 13 | } 14 | extend interface Intf @nonRepeatable 15 | type Query { 16 | x: Int 17 | } 18 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0081_directive_is_unique_type_system.graphql: -------------------------------------------------------------------------------- 1 | directive @nonRepeatable on 2 | SCHEMA | SCALAR | OBJECT | INTERFACE | UNION | INPUT_OBJECT 3 | schema @nonRepeatable @nonRepeatable { query: Dummy } 4 | scalar TestScalar @nonRepeatable @nonRepeatable @specifiedBy(url: "example.com") 5 | type Dummy @nonRepeatable @nonRepeatable 6 | interface TestInterface @nonRepeatable @nonRepeatable 7 | union TestUnion @nonRepeatable @nonRepeatable 8 | input TestInput @nonRepeatable @nonRepeatable 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0082_introspection_types_in_mutation.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: MyQueryRootType 3 | mutation: MyMutationRootType 4 | } 5 | 6 | type MyQueryRootType { 7 | someField: String 8 | } 9 | 10 | type MyMutationRootType { 11 | setSomeField(to: String): String 12 | } 13 | 14 | mutation introspect { 15 | __type(name: "User") { 16 | name 17 | fields { 18 | name 19 | type { 20 | name 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0083_type_introspection_from_disallowed_type.txt: -------------------------------------------------------------------------------- 1 | Error: type `Product` does not have a field `__type` 2 | ╭─[ 0083_type_introspection_from_disallowed_type.graphql:4:5 ] 3 | │ 4 | 4 │ __type(name: "User") { 5 | │ ───┬── 6 | │ ╰──── field `__type` selected here 7 | │ 8 | 24 │ type Product { 9 | │ ───┬─── 10 | │ ╰───── type `Product` defined here 11 | │ 12 | │ Note: path to the field: `query getProduct → topProducts → __type` 13 | ────╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0084_circular_non_nullable_input_objects.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | example(arg: First): Int 4 | } 5 | 6 | input First { 7 | second: Second! 8 | value: String 9 | } 10 | 11 | input Second { 12 | third: Third! 13 | value: String 14 | } 15 | 16 | input Third { 17 | fourth: Fourth! 18 | value: String 19 | } 20 | 21 | input Fourth { 22 | first: First! 23 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0085_fragment_spread_target_defined.graphql: -------------------------------------------------------------------------------- 1 | type Dog { 2 | name: String! 3 | } 4 | type Query { 5 | dog: Dog 6 | } 7 | 8 | { 9 | dog { 10 | ...undefinedFragment 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0085_fragment_spread_target_defined.txt: -------------------------------------------------------------------------------- 1 | Error: cannot find fragment `undefinedFragment` in this document 2 | ╭─[ 0085_fragment_spread_target_defined.graphql:10:5 ] 3 | │ 4 | 10 │ ...undefinedFragment 5 | │ ──────────┬───────── 6 | │ ╰─────────── fragment `undefinedFragment` is not defined 7 | ────╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0086_unused_fragment.graphql: -------------------------------------------------------------------------------- 1 | query Query { 2 | products { 3 | inStock 4 | name 5 | } 6 | } 7 | 8 | type Query { 9 | products: Product 10 | } 11 | 12 | type Product { 13 | inStock: Boolean 14 | name: String 15 | } 16 | 17 | fragment nameFragment on Product { 18 | name 19 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0086_unused_fragment.txt: -------------------------------------------------------------------------------- 1 | Error: fragment `nameFragment` must be used in an operation 2 | ╭─[ 0086_unused_fragment.graphql:17:1 ] 3 | │ 4 | 17 │ ╭─▶ fragment nameFragment on Product { 5 | ┆ ┆ 6 | 19 │ ├─▶ } 7 | │ │ 8 | │ ╰────── `nameFragment` is defined here 9 | │ 10 | │ Help: fragment `nameFragment` must be used in an operation 11 | ────╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0088_fragment_selection_set.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | topProducts: Product 4 | } 5 | 6 | type Product { 7 | inStock: Boolean 8 | name: String 9 | } 10 | 11 | query getProduct { 12 | name 13 | topProduct { 14 | ...productFragment 15 | } 16 | topProducts { 17 | ...productFragment 18 | } 19 | } 20 | 21 | fragment productFragment on Product { 22 | notExistingField 23 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0091_recursive_interface_definition.graphql: -------------------------------------------------------------------------------- 1 | interface A implements B { 2 | name: String 3 | } 4 | interface B implements A { 5 | name: String 6 | } 7 | type Impl implements A & B { 8 | name: String 9 | } 10 | type Query { 11 | get: A 12 | } 13 | 14 | fragment recursive on A { 15 | name 16 | } 17 | 18 | query { 19 | get { ...recursive } 20 | } 21 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0093_fragment_validation_with_recursive_type_system.graphql: -------------------------------------------------------------------------------- 1 | # ensure we don't get a stack overflow when the type system is recursive 2 | interface A implements B { 3 | a: A 4 | b: B 5 | } 6 | interface B implements A { 7 | a: A 8 | b: B 9 | } 10 | 11 | type C implements A & B { 12 | a: A 13 | b: B 14 | value: Int! 15 | } 16 | 17 | type Query { 18 | c: C 19 | } 20 | 21 | fragment b on C { 22 | value 23 | } 24 | 25 | query { 26 | c { ... b } 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0096_schema_extensions.graphql: -------------------------------------------------------------------------------- 1 | # Any non-repeatable directives provided must not already apply to the original Schema. 2 | directive @nonRepeatable on SCHEMA 3 | 4 | type Query { 5 | viewCount: Int! 6 | } 7 | 8 | schema @nonRepeatable { 9 | query: Query 10 | } 11 | extend schema @nonRepeatable 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0096_schema_extensions.txt: -------------------------------------------------------------------------------- 1 | Error: non-repeatable directive nonRepeatable can only be used once per location 2 | ╭─[ 0096_schema_extensions.graphql:11:15 ] 3 | │ 4 | 8 │ schema @nonRepeatable { 5 | │ ───────┬────── 6 | │ ╰──────── directive `@nonRepeatable` first called here 7 | │ 8 | 11 │ extend schema @nonRepeatable 9 | │ ───────┬────── 10 | │ ╰──────── directive `@nonRepeatable` called again here 11 | ────╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0097_enum_extensions.graphql: -------------------------------------------------------------------------------- 1 | directive @nonRepeatable on ENUM 2 | 3 | enum E { 4 | MEMBER_1 5 | MEMBER_2 6 | } 7 | 8 | extend enum E @nonRepeatable { 9 | MEMBER_3 10 | MEMBER_4 11 | } 12 | 13 | extend enum E @nonRepeatable { 14 | MEMBER_2 15 | MEMBER_4 16 | } 17 | 18 | type Query { 19 | x: Int 20 | } 21 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0099_input_object_extensions.graphql: -------------------------------------------------------------------------------- 1 | input UniqueNames { 2 | field: String 3 | } 4 | extend input UniqueNames { 5 | field: String 6 | } 7 | 8 | directive @nonRepeatable on INPUT_OBJECT 9 | input UniqueDirective @nonRepeatable { 10 | field: String 11 | } 12 | extend input UniqueDirective @nonRepeatable 13 | 14 | type Query { 15 | x: Int 16 | } 17 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0103_invalid_directive_on_input_value.graphql: -------------------------------------------------------------------------------- 1 | directive @example(arg: String!) on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION 2 | 3 | input Input { 4 | key: String! @example 5 | } 6 | 7 | directive @directive(arg2: Int @example) on SCHEMA 8 | 9 | type Query { 10 | x: Int 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0105_executable_definition_in_type_system_document.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | field: Int 3 | } 4 | 5 | query { 6 | field 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0105_executable_definition_in_type_system_document.txt: -------------------------------------------------------------------------------- 1 | Error: a schema document must not contain an operation definition 2 | ╭─[ 0105_executable_definition_in_type_system_document.graphql:5:1 ] 3 | │ 4 | 5 │ ╭─▶ query { 5 | ┆ ┆ 6 | 7 │ ├─▶ } 7 | │ │ 8 | │ ╰─────── remove this definition, or use `parse_mixed()` 9 | ───╯ 10 | 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0106_type_system_definition_in_executable_document.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | field: Int 3 | } 4 | 5 | query { 6 | field 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0106_type_system_definition_in_executable_document.txt: -------------------------------------------------------------------------------- 1 | Error: an executable document must not contain an object type definition 2 | ╭─[ 0106_type_system_definition_in_executable_document.graphql:1:1 ] 3 | │ 4 | 1 │ ╭─▶ type Query { 5 | ┆ ┆ 6 | 3 │ ├─▶ } 7 | │ │ 8 | │ ╰─────── remove this definition, or use `parse_mixed()` 9 | ───╯ 10 | 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0108_implicit_schema_extension.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | 5 | extend schema { 6 | query: Query 7 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0108_implicit_schema_extension.txt: -------------------------------------------------------------------------------- 1 | Error: duplicate definitions for the `query` root operation type 2 | ╭─[ 0108_implicit_schema_extension.graphql:6:5 ] 3 | │ 4 | 6 │ query: Query 5 | │ ──────┬───── 6 | │ ╰─────── `query` redefined here 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0109_null_in_list_issue_738.graphql: -------------------------------------------------------------------------------- 1 | scalar CustomScalar @specifiedBy(url: "https://example.com") 2 | 3 | input WithList { 4 | list: [String!] 5 | } 6 | 7 | type Query { 8 | foo(arg: [CustomScalar!]!): String! 9 | bar(arg: [String!]): String! 10 | list(arg: WithList): String! 11 | } 12 | 13 | { 14 | a: foo(arg: [null, 1]) 15 | b: foo(arg: [null, null, "hello"]) 16 | bar(arg: [null]) 17 | list(arg: {list: ["ok", null]}) 18 | } 19 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0111_const_value.graphql: -------------------------------------------------------------------------------- 1 | query( 2 | $var1: Boolean! 3 | $var2: Boolean! = $var1 4 | ) { 5 | f1 @include(if: $var1) 6 | f2 @include(if: $var2) 7 | } 8 | 9 | directive @someDir(arg: Boolean) on OBJECT 10 | 11 | type Query @someDir(arg: $var1) { 12 | f1: Int 13 | f2: Int 14 | } 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0112_anonymous_subscription_with_multiple_root_fields.graphql: -------------------------------------------------------------------------------- 1 | subscription { 2 | newMessage { 3 | body 4 | sender 5 | } 6 | disallowedSecondRootField 7 | } 8 | 9 | type Subscription { 10 | newMessage: Result 11 | disallowedSecondRootField: String 12 | } 13 | 14 | type Result { 15 | body: String, 16 | sender: String 17 | } 18 | 19 | type Query { 20 | message: String 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0112_anonymous_subscription_with_multiple_root_fields.txt: -------------------------------------------------------------------------------- 1 | Error: anonymous subscription can only have one root field 2 | ╭─[ 0112_anonymous_subscription_with_multiple_root_fields.graphql:1:1 ] 3 | │ 4 | 1 │ ╭─▶ subscription { 5 | ┆ ┆ 6 | 7 │ ├─▶ } 7 | │ │ 8 | │ ╰─────── subscription with 2 root fields 9 | │ 10 | │ Help: There are 2 root fields: newMessage, disallowedSecondRootField. This is not allowed. 11 | ───╯ 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0114_interface_definition_with_missing_fields.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on INTERFACE 2 | type Query { 3 | foo: Node 4 | } 5 | 6 | interface Node 7 | 8 | extend interface Node @foo -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0114_interface_definition_with_missing_fields.txt: -------------------------------------------------------------------------------- 1 | Error: `Node` has no fields 2 | ╭─[ 0114_interface_definition_with_missing_fields.graphql:6:1 ] 3 | │ 4 | 6 │ interface Node 5 | │ ───────┬────── 6 | │ ╰──────── Node type defined here 7 | │ 8 | 8 │ extend interface Node @foo 9 | │ ─────────────┬──────────── 10 | │ ╰────────────── Node extension defined here 11 | │ 12 | │ Help: Define one or more fields on `Node` or its type extensions. 13 | ───╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0115_object_definition_with_missing_fields.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on OBJECT 2 | directive @bar on OBJECT 3 | type Query { 4 | foo: User 5 | } 6 | 7 | type User @foo 8 | 9 | extend type User @bar 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0115_object_definition_with_missing_fields.txt: -------------------------------------------------------------------------------- 1 | Error: `User` has no fields 2 | ╭─[ 0115_object_definition_with_missing_fields.graphql:7:1 ] 3 | │ 4 | 7 │ type User @foo 5 | │ ───────┬────── 6 | │ ╰──────── User type defined here 7 | │ 8 | 9 │ extend type User @bar 9 | │ ──────────┬────────── 10 | │ ╰──────────── User extension defined here 11 | │ 12 | │ Help: Define one or more fields on `User` or its type extensions. 13 | ───╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0116_enum_definition_with_missing_values.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on ENUM 2 | type Query { 3 | foo: WEEKDAY 4 | } 5 | 6 | enum WEEKDAY 7 | 8 | extend enum WEEKDAY @foo -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0116_enum_definition_with_missing_values.txt: -------------------------------------------------------------------------------- 1 | Error: `WEEKDAY` has no enum values 2 | ╭─[ 0116_enum_definition_with_missing_values.graphql:6:1 ] 3 | │ 4 | 6 │ enum WEEKDAY 5 | │ ──────┬───── 6 | │ ╰─────── WEEKDAY type defined here 7 | │ 8 | 8 │ extend enum WEEKDAY @foo 9 | │ ────────────┬─────────── 10 | │ ╰───────────── WEEKDAY extension defined here 11 | │ 12 | │ Help: Define one or more enum values on `WEEKDAY` or its type extensions. 13 | ───╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0117_union_definition_with_missing_members.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on UNION 2 | type Query { 3 | foo: Search 4 | } 5 | 6 | union Search 7 | 8 | extend union Search @foo -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0117_union_definition_with_missing_members.txt: -------------------------------------------------------------------------------- 1 | Error: `Search` has no member types 2 | ╭─[ 0117_union_definition_with_missing_members.graphql:6:1 ] 3 | │ 4 | 6 │ union Search 5 | │ ──────┬───── 6 | │ ╰─────── Search type defined here 7 | │ 8 | 8 │ extend union Search @foo 9 | │ ────────────┬─────────── 10 | │ ╰───────────── Search extension defined here 11 | │ 12 | │ Help: Define one or more union member types on `Search` or its type extensions. 13 | ───╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0118_input_object_definition_with_missing_values.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on INPUT_OBJECT 2 | type Query { 3 | foo(id: In): String 4 | } 5 | 6 | input In 7 | 8 | extend input In @foo -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0118_input_object_definition_with_missing_values.txt: -------------------------------------------------------------------------------- 1 | Error: `In` has no input values 2 | ╭─[ 0118_input_object_definition_with_missing_values.graphql:6:1 ] 3 | │ 4 | 6 │ input In 5 | │ ────┬─── 6 | │ ╰───── In type defined here 7 | │ 8 | 8 │ extend input In @foo 9 | │ ──────────┬───────── 10 | │ ╰─────────── In extension defined here 11 | │ 12 | │ Help: Define one or more input values on `In` or its type extensions. 13 | ───╯ 14 | 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0119_reserved_names.graphql: -------------------------------------------------------------------------------- 1 | directive @__Prime(__if: Boolean!) on SCHEMA 2 | 3 | schema @__Prime(__if: true) { 4 | query: __MyQuery 5 | } 6 | 7 | type __MyQuery { 8 | __secretField(__heatedArgument: __In): Int 9 | } 10 | 11 | input __In { 12 | __amount: __BigInt 13 | } 14 | 15 | scalar __BigInt 16 | 17 | enum __Maybe { 18 | Yes 19 | No 20 | __FileNotFound 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0120_conditional_subscriptions.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalSub($condition: Boolean = true) { 2 | ticker @include(if: $condition) 3 | } 4 | 5 | type Query { 6 | hello: String 7 | } 8 | 9 | type Subscription { 10 | ticker: String 11 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0120_conditional_subscriptions.txt: -------------------------------------------------------------------------------- 1 | Error: subscription `ConditionalSub` can not specify @skip or @include on root fields 2 | ╭─[ 0120_conditional_subscriptions.graphql:2:12 ] 3 | │ 4 | 2 │ ticker @include(if: $condition) 5 | │ ────────────┬─────────── 6 | │ ╰───────────── conditional directive used here 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0121_conditional_subscriptions_with_inline_fragment.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ... @include(if: $condition) { 3 | ticker 4 | } 5 | } 6 | 7 | type Query { 8 | hello: String 9 | } 10 | 11 | type Subscription { 12 | ticker: String 13 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0121_conditional_subscriptions_with_inline_fragment.txt: -------------------------------------------------------------------------------- 1 | Error: subscription `ConditionalInlineSub` can not specify @skip or @include on root fields 2 | ╭─[ 0121_conditional_subscriptions_with_inline_fragment.graphql:2:9 ] 3 | │ 4 | 2 │ ... @include(if: $condition) { 5 | │ ────────────┬─────────── 6 | │ ╰───────────── conditional directive used here 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0122_conditional_subscriptions_with_named_fragment.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ...mySubscription @include(if: $condition) 3 | } 4 | 5 | fragment mySubscription on Subscription { 6 | ticker 7 | } 8 | 9 | type Query { 10 | hello: String 11 | } 12 | 13 | type Subscription { 14 | ticker: String 15 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0122_conditional_subscriptions_with_named_fragment.txt: -------------------------------------------------------------------------------- 1 | Error: subscription `ConditionalInlineSub` can not specify @skip or @include on root fields 2 | ╭─[ 0122_conditional_subscriptions_with_named_fragment.graphql:2:23 ] 3 | │ 4 | 2 │ ...mySubscription @include(if: $condition) 5 | │ ────────────┬─────────── 6 | │ ╰───────────── conditional directive used here 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0123_conditional_subscriptions_inside_inline_fragment.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ... { 3 | ticker @include(if: $condition) 4 | } 5 | } 6 | 7 | type Query { 8 | hello: String 9 | } 10 | 11 | type Subscription { 12 | ticker: String 13 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0123_conditional_subscriptions_inside_inline_fragment.txt: -------------------------------------------------------------------------------- 1 | Error: subscription `ConditionalInlineSub` can not specify @skip or @include on root fields 2 | ╭─[ 0123_conditional_subscriptions_inside_inline_fragment.graphql:3:16 ] 3 | │ 4 | 3 │ ticker @include(if: $condition) 5 | │ ────────────┬─────────── 6 | │ ╰───────────── conditional directive used here 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0124_conditional_subscriptions_inside_named_fragment.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ...mySubscription 3 | } 4 | 5 | fragment mySubscription on Subscription { 6 | ticker @include(if: $condition) 7 | } 8 | 9 | type Query { 10 | hello: String 11 | } 12 | 13 | type Subscription { 14 | ticker: String 15 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/diagnostics/0124_conditional_subscriptions_inside_named_fragment.txt: -------------------------------------------------------------------------------- 1 | Error: subscription `ConditionalInlineSub` can not specify @skip or @include on root fields 2 | ╭─[ 0124_conditional_subscriptions_inside_named_fragment.graphql:6:12 ] 3 | │ 4 | 6 │ ticker @include(if: $condition) 5 | │ ────────────┬─────────── 6 | │ ╰───────────── conditional directive used here 7 | ───╯ 8 | 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0001_annonymous_operation_definition.graphql: -------------------------------------------------------------------------------- 1 | 2 | query { 3 | cat { 4 | name 5 | } 6 | } 7 | 8 | type Query { 9 | cat: Pet 10 | } 11 | 12 | type Pet { 13 | name: String 14 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0002_multiple_named_operation_definitions.graphql: -------------------------------------------------------------------------------- 1 | query getCatName { 2 | cat { 3 | name 4 | } 5 | } 6 | 7 | query getOwnerName { 8 | cat { 9 | owner { 10 | name 11 | } 12 | } 13 | } 14 | 15 | 16 | type Query { 17 | cat: Pet 18 | } 19 | 20 | type Pet { 21 | name: String, 22 | owner: PetOwner 23 | } 24 | 25 | type PetOwner { 26 | name: String 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0004_schema_with_custom_scalars.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | website: URL, 3 | amount: Int 4 | } 5 | 6 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0005_schema_with_valid_enum_definitions.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Pet, 3 | snacks: Snack, 4 | } 5 | 6 | enum Pet { 7 | CAT 8 | DOG 9 | FOX 10 | } 11 | 12 | enum Snack { 13 | THRIVE_PET_FOODS 14 | LILYS_KITCHEN 15 | ACANA 16 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0006_schema_with_valid_union.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: SearchQuery 3 | } 4 | 5 | union SearchResult = Photo | Person 6 | 7 | type Person { 8 | name: String 9 | age: Int 10 | } 11 | 12 | type Photo { 13 | height: Int 14 | width: Int 15 | } 16 | 17 | type SearchQuery { 18 | firstSearchResult: SearchResult 19 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0007_schema_with_interface_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node { 2 | id: ID! 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource implements Node { 10 | id: ID! 11 | width: Int 12 | height: Int 13 | } 14 | 15 | interface Image implements Resource & Node { 16 | id: ID! 17 | width: Int 18 | height: Int 19 | thumbnail: String 20 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0008_schema_with_directive_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | literature: Book 3 | } 4 | 5 | directive @delegateField(name: String!) repeatable on OBJECT | INTERFACE 6 | 7 | type Book @delegateField(name: "pageCount") @delegateField(name: "author") { 8 | id: ID! 9 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0009_schema_with_input_object.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | website: URL, 3 | amount: Int 4 | } 5 | 6 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 7 | 8 | input Point2D { 9 | x: Float 10 | y: Float 11 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0011_fragment_spreads_in_fragment_definitions.graphql: -------------------------------------------------------------------------------- 1 | query IntrospectionQuery { 2 | foo { 3 | ...Bar 4 | } 5 | } 6 | 7 | fragment Bar on Foo { 8 | baz { 9 | ...Quux 10 | } 11 | } 12 | 13 | fragment Quux on Baz { 14 | id 15 | } 16 | 17 | type Query { 18 | foo: Foo 19 | } 20 | 21 | type Foo { 22 | baz: Baz 23 | } 24 | 25 | type Baz { 26 | id: ID 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0014_float_values.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name(arg: WithAllKindsOfFloats): String 3 | } 4 | 5 | input WithAllKindsOfFloats { 6 | a_regular_float: Float = 1.2 7 | an_integer_float: Float = 1234 8 | a_float_that_doesnt_fit_an_int: Float = 9876543210 9 | list_of_floats: [Float] = [4, 9876543210, 98765432109876543210] 10 | } 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0016_same_variables_in_multiple_operations.graphql: -------------------------------------------------------------------------------- 1 | query A($atOtherHomes: Boolean) { 2 | ...HouseTrainedFragment 3 | } 4 | 5 | query B($atOtherHomes: Boolean) { 6 | ...HouseTrainedFragment 7 | } 8 | 9 | fragment HouseTrainedFragment on Query { 10 | dog { 11 | isHouseTrained(atOtherHomes: $atOtherHomes) 12 | } 13 | } 14 | 15 | type Query { 16 | dog: Dog 17 | } 18 | 19 | type Dog { 20 | name: String! 21 | nickname: String 22 | barkVolume: Int 23 | isHouseTrained(atOtherHomes: Boolean): Boolean! 24 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0018_non_clashing_names.graphql: -------------------------------------------------------------------------------- 1 | # Types, directives, fragments, and operations each have their own namespace. 2 | type A @A { 3 | a: Int 4 | } 5 | type Query { 6 | a: A 7 | } 8 | 9 | directive @A on OBJECT 10 | 11 | fragment A on A { 12 | a 13 | } 14 | 15 | query A { 16 | a { 17 | ...A 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0020_merge_identical_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Dog 3 | } 4 | 5 | type Dog { 6 | nickname: String 7 | name: String! 8 | } 9 | 10 | query queryPupper { 11 | pet { 12 | ...mergeIdenticalFields 13 | ...mergeIdenticalAliasesAndFields 14 | } 15 | } 16 | 17 | fragment mergeIdenticalFields on Dog { 18 | name 19 | name 20 | } 21 | 22 | fragment mergeIdenticalAliasesAndFields on Dog { 23 | otherName: name 24 | otherName: name 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0025_unique_directives.graphql: -------------------------------------------------------------------------------- 1 | directive @repeatable repeatable on FIELD 2 | directive @unique on FIELD 3 | 4 | type Query { 5 | field: Int 6 | } 7 | 8 | { 9 | field @repeatable @repeatable 10 | field @unique 11 | field @unique 12 | } 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0026_type_introspection.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | id: String 3 | name: String 4 | birthday: Date 5 | } 6 | 7 | scalar Date @specifiedBy(url: "datespec.com") 8 | 9 | { 10 | __type(name: "User") { 11 | name 12 | fields { 13 | name 14 | type { 15 | name 16 | } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0027_typename_introspection_in_object.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | id: String 3 | name: String 4 | birthday: Date 5 | } 6 | 7 | scalar Date @specifiedBy(url: "datespec.com") 8 | 9 | { 10 | name 11 | __typename 12 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0028_typename_introspection_in_union.graphql: -------------------------------------------------------------------------------- 1 | union SearchResult = Photo | Person 2 | 3 | type Person { 4 | name: String 5 | age: Int 6 | } 7 | 8 | type Photo { 9 | height: Int 10 | width: Int 11 | } 12 | 13 | type Query { 14 | firstSearchResult: SearchResult 15 | } 16 | 17 | { 18 | firstSearchResult { 19 | __typename 20 | ... on Person { 21 | name 22 | } 23 | ... on Photo { 24 | height 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0029_used_variable_in_list_and_input.graphql: -------------------------------------------------------------------------------- 1 | type Product { 2 | attributes(includeNames: [String!]): [String!] 3 | } 4 | 5 | input Opts { 6 | prop: [[Int]!]! 7 | } 8 | 9 | type Query { 10 | field( 11 | opts: Opts 12 | ): [Product] 13 | } 14 | 15 | query ($attributeName: String!, $v: Int) { 16 | field(opts: { 17 | prop: [[2], [$v], [4]], 18 | }) { 19 | attributes(includeNames: [$attributeName]) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0030_cyclical_nullable_input_objects.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | example(arg: First): Int 4 | } 5 | 6 | input First { 7 | second: Second 8 | value: String 9 | } 10 | 11 | input Second { 12 | third: [Third!]! 13 | value: String 14 | } 15 | 16 | input Third { 17 | fourth: Fourth 18 | value: String 19 | } 20 | 21 | input Fourth { 22 | first: First 23 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0034_built_in_directive_redefinition.graphql: -------------------------------------------------------------------------------- 1 | schema 2 | @deprecated( 3 | reason: """ 4 | The person who got promoted by shipping this product has moved on to another team. 5 | The service will shut down next month. 6 | """ 7 | ) { 8 | query: Query 9 | } 10 | 11 | type Query { 12 | importantData: Int 13 | } 14 | 15 | directive @deprecated( 16 | reason: String = "No longer supported" 17 | ) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE | SCHEMA 18 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0035_implicit_schema_definition_with_query_type.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0036_implicit_schema_definition_with_several_default_types.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | 5 | type Mutation { 6 | add(name: String!): Result! 7 | } 8 | 9 | type Result { 10 | id: String 11 | } 12 | 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0037_implicit_schema_extension_with_directive.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | 5 | extend schema @dir 6 | directive @dir on SCHEMA -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0038_argument_default.graphql: -------------------------------------------------------------------------------- 1 | directive @defer( 2 | label: String 3 | if: Boolean! = true 4 | ) on FRAGMENT_SPREAD | INLINE_FRAGMENT 5 | 6 | type Query { 7 | guitarAmp(upTo: Int! = 11): String 8 | } 9 | 10 | { 11 | ... @defer { 12 | guitarAmp 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0041_unquoted_string_for_custom_scalar.graphql: -------------------------------------------------------------------------------- 1 | scalar Currency 2 | 3 | type Query { 4 | convertToUSD(amount: Int!, currency: Currency!): Int! 5 | } 6 | 7 | query { 8 | convertToUSD(amount: 100, currency: EUR) 9 | } 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0042_used_variable_in_operation_directive.graphql: -------------------------------------------------------------------------------- 1 | directive @x(y: Int!) on QUERY | MUTATION | SUBSCRIPTION 2 | directive @z(f: Boolean) on FRAGMENT_DEFINITION 3 | 4 | type Query { field: Boolean } 5 | type Mutation { field: Boolean } 6 | type Subscription { field: Boolean } 7 | 8 | query Q ($a: Int!, $f: Boolean) @x(y: $a) { field ...f } 9 | mutation M ($b: Int!) @x(y: $b) { field } 10 | subscription S ($c: Int!) @x(y: $c) { field } 11 | 12 | fragment f on Query @z(f: $f) { field } 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0115_interface_definition_with_extension_defines_field.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | foo: Node 3 | } 4 | 5 | interface Node 6 | 7 | extend interface Node { 8 | bar: String 9 | } 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0116_interface_without_implementations.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | intf: Intf 3 | } 4 | interface Intf { 5 | field: Int 6 | } 7 | 8 | query SelectDirectly { 9 | intf { field } 10 | } 11 | 12 | query UsingInlineFragment { 13 | intf { 14 | ... on Intf { field } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/ok/0117_subscription_conditions_not_at_root.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalSub($includeContent: Boolean = true, $small: Boolean = true) { 2 | messages { 3 | username 4 | text @include(if: $includeContent) 5 | avatar @skip(if: $small) 6 | } 7 | } 8 | 9 | type Query { 10 | hello: String 11 | } 12 | 13 | type Message { 14 | username: String 15 | text: String 16 | avatar: String 17 | } 18 | 19 | type Subscription { 20 | messages: Message 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0001_duplicate_operatoin_names.graphql: -------------------------------------------------------------------------------- 1 | query getName { 2 | cat 3 | } 4 | 5 | query getName { 6 | cat 7 | } 8 | 9 | type Query { 10 | cat: String 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0002_multiple_anonymous_operations.graphql: -------------------------------------------------------------------------------- 1 | { 2 | cat 3 | } 4 | 5 | mutation { 6 | addPet(name: "Example") { 7 | response 8 | } 9 | } 10 | 11 | type Query { 12 | cat: String 13 | } 14 | 15 | type Mutation { 16 | addPet(name: String!, petType: PetType): Result! 17 | } 18 | 19 | enum PetType { 20 | CAT 21 | DOG 22 | } 23 | 24 | type Result { 25 | pageNumber: Int 26 | response: String 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0003_anonymous_and_named_operation.graphql: -------------------------------------------------------------------------------- 1 | { 2 | cat 3 | } 4 | 5 | mutation getName { 6 | addPet { 7 | response 8 | } 9 | } 10 | 11 | type Query { 12 | cat: String 13 | } 14 | 15 | type Mutation { 16 | addPet(name: String!, petType: PetType): Result! 17 | } 18 | 19 | enum PetType { 20 | CAT 21 | DOG 22 | } 23 | 24 | type Result { 25 | pageNumber: Int 26 | response: String 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0004_subscription_with_multiple_root_fields.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | newMessage { 3 | body 4 | sender 5 | } 6 | disallowedSecondRootField 7 | } 8 | 9 | type Subscription { 10 | newMessage: Result 11 | disallowedSecondRootField: String 12 | } 13 | 14 | type Result { 15 | body: String 16 | sender: String 17 | } 18 | 19 | type Query { 20 | message: String 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0005_subscription_with_multiple_root_fields_in_fragment_spreads.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | ...multipleSubscriptions 3 | } 4 | 5 | fragment multipleSubscriptions on Subscription { 6 | newMessage { 7 | body 8 | sender 9 | } 10 | disallowedSecondRootField 11 | } 12 | 13 | type Subscription { 14 | newMessage: Result 15 | disallowedSecondRootField: String 16 | } 17 | 18 | type Result { 19 | body: String 20 | sender: String 21 | } 22 | 23 | type Query { 24 | message: String 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0006_subscription_with_multiple_root_fields_in_inline_fragments.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | ... on Subscription { 3 | newMessage { 4 | body 5 | sender 6 | } 7 | disallowedSecondRootField 8 | } 9 | } 10 | 11 | type Subscription { 12 | newMessage: Result 13 | disallowedSecondRootField: String 14 | } 15 | 16 | type Result { 17 | body: String 18 | sender: String 19 | } 20 | 21 | type Query { 22 | message: String 23 | } 24 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0007_operation_with_undefined_variables.graphql: -------------------------------------------------------------------------------- 1 | query ExampleQuery { 2 | topProducts(first: $undefinedVariable, filter: {offset: $offset, keywords: ["a", $keyword]}) { 3 | name 4 | } 5 | } 6 | 7 | input Filter { 8 | keywords: [String!] 9 | offset: Int 10 | limit: Int 11 | } 12 | 13 | type Query { 14 | topProducts(first: Int, filter: Filter): Product 15 | } 16 | 17 | type Product { 18 | name: String 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0008_operation_with_undefined_variables_in_inline_fragment.graphql: -------------------------------------------------------------------------------- 1 | query ExampleQuery { 2 | topProducts { 3 | name 4 | ... on Product { 5 | price(setPrice: $value) 6 | } 7 | } 8 | } 9 | 10 | type Query { 11 | topProducts(first: Int): Product 12 | } 13 | 14 | type Product { 15 | name: String 16 | price(setPrice: Int): Int 17 | } 18 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0010_operation_with_unused_variable.graphql: -------------------------------------------------------------------------------- 1 | query ExampleQuery($unusedVariable: Int) { 2 | topProducts { 3 | name 4 | } 5 | } 6 | 7 | type Query { 8 | topProducts(first: Int): Product 9 | } 10 | 11 | type Product { 12 | name: String 13 | price(setPrice: Int): Int 14 | } 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0011_syntactic_errors_from_parser.graphql: -------------------------------------------------------------------------------- 1 | query getName {} 2 | 3 | type Query { 4 | topProducts(first: Int): Product 5 | } 6 | 7 | type Product { 8 | name: String 9 | birthday: String 10 | } 11 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0012_schema_definition_with_missing_query_operation_type.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | subscription: customSubscription 3 | } 4 | 5 | type customSubscription { 6 | changeInPetHousehold: Result 7 | } 8 | 9 | type Result { 10 | id: String 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0013_schema_definition_with_duplicate_root_type_operations.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: customPetQuery 3 | query: thatOtherQuery 4 | } 5 | 6 | type customPetQuery { 7 | name: String 8 | } 9 | 10 | type thatOtherQuery { 11 | age: Int 12 | } 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0014_subscription_operation_without_subscription_schema_operation_type.graphql: -------------------------------------------------------------------------------- 1 | subscription messageSubscription { 2 | newMessage { 3 | body 4 | sender 5 | } 6 | } 7 | 8 | schema { 9 | query: customPetQuery 10 | } 11 | 12 | type customPetQuery { 13 | name: String 14 | newMessage: Message 15 | age: Int 16 | } 17 | 18 | type Message { 19 | body: String 20 | sender: String 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0015_mutation_operation_without_mutation_schema_definition.graphql: -------------------------------------------------------------------------------- 1 | mutation adoptAPetMutation { 2 | addPet { 3 | owner { 4 | name 5 | } 6 | } 7 | } 8 | 9 | type Query { 10 | name: String 11 | age: Int 12 | } 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0016_schema_with_built_in_scalar_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | amount: Int 3 | } 4 | 5 | scalar Int 6 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0017_schema_with_unspecified_scalar.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apollographql/apollo-rs/70aba3ffcafdeb892b9791c1bfed86ff928dc2f6/crates/apollo-compiler/test_data/serializer/diagnostics/0017_schema_with_unspecified_scalar.graphql -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0018_schema_with_specified_scalar_missing_values.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apollographql/apollo-rs/70aba3ffcafdeb892b9791c1bfed86ff928dc2f6/crates/apollo-compiler/test_data/serializer/diagnostics/0018_schema_with_specified_scalar_missing_values.graphql -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0019_enum_definition_with_duplicate_values.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Pet 3 | snacks: Snack 4 | } 5 | 6 | enum Pet { 7 | CAT 8 | DOG 9 | FOX 10 | CAT 11 | } 12 | 13 | enum Snack { 14 | THRIVE_PET_FOODS 15 | LILYS_KITCHEN 16 | ACANA 17 | THRIVE_PET_FOODS 18 | } 19 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0020_enum_values_with_uncapitalised_values.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apollographql/apollo-rs/70aba3ffcafdeb892b9791c1bfed86ff928dc2f6/crates/apollo-compiler/test_data/serializer/diagnostics/0020_enum_values_with_uncapitalised_values.graphql -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0021_union_definition_with_duplicate_members.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: SearchQuery 3 | } 4 | 5 | union SearchResult = Photo | Photo 6 | 7 | type Person { 8 | name: String 9 | age: Int 10 | } 11 | 12 | type Photo { 13 | height: Int 14 | width: Int 15 | } 16 | 17 | type SearchQuery { 18 | firstSearchResult: SearchResult 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0022_duplicate_interface_definitions.graphql: -------------------------------------------------------------------------------- 1 | type Query implements NamedEntity { 2 | name: String 3 | } 4 | 5 | interface NamedEntity { 6 | name: String 7 | } 8 | 9 | interface NamedEntity { 10 | name: String 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0023_interface_definition_with_cyclic_implements_interfaces.graphql: -------------------------------------------------------------------------------- 1 | type Query implements NamedEntity { 2 | name: String 3 | } 4 | 5 | interface NamedEntity implements NamedEntity { 6 | name: String 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0024_interface_definition_with_duplicate_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query implements NamedEntity { 2 | name: String 3 | } 4 | 5 | interface NamedEntity { 6 | name: String 7 | name: String 8 | } 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0025_interface_definition_with_missing_transitive_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node { 2 | id: ID! 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource implements Node { 10 | id: ID! 11 | width: Int 12 | } 13 | 14 | interface Image implements Resource & Node { 15 | id: ID! 16 | thumbnail: String 17 | } 18 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0026_interface_definition_with_missing_implemetns_interface.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node { 2 | id: ID! 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource implements Node { 10 | id: ID! 11 | url: String 12 | width: Int 13 | } 14 | 15 | interface Image implements Resource { 16 | id: ID! 17 | url: String 18 | width: Int 19 | thumbnail: String 20 | } 21 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0027_interface_definition_with_undefined_implements_interface.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Resource { 2 | id: ID! 3 | width: Int 4 | } 5 | 6 | interface Resource { 7 | id: ID! 8 | width: Int 9 | } 10 | 11 | interface Image implements Resource & Url { 12 | id: ID! 13 | url: String 14 | width: Int 15 | thumbnail: String 16 | } 17 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0028_interface_definition_with_missing_fields_implements_intrefaces_undefined_interfaces.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node { 2 | id: ID! 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource implements Node { 10 | id: ID! 11 | width: Int 12 | } 13 | 14 | interface Image implements Resource & Url { 15 | id: ID! 16 | thumbnail: String 17 | } 18 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0029_directive_definitions_with_duplicate_names.graphql: -------------------------------------------------------------------------------- 1 | schema @foo { 2 | query: Query 3 | } 4 | 5 | type Query { 6 | id: ID! 7 | field: String 8 | } 9 | 10 | directive @foo on SCHEMA 11 | 12 | directive @foo on SCHEMA 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0030_schema_with_duplicate_input_objects.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | website: URL 3 | amount: Int 4 | } 5 | 6 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 7 | 8 | input Point2D { 9 | x: Float 10 | y: Float 11 | } 12 | 13 | input Point2D { 14 | x: Float 15 | y: Float 16 | } 17 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0031_input_object_with_duplicate_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | website: URL 3 | amount: Int 4 | } 5 | 6 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 7 | 8 | input Point2D { 9 | x: Float 10 | x: Float 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0032_duplicate_object_type_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | 5 | type Query { 6 | name: String 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0033_object_type_definition_with_duplicate_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | name: String 4 | } 5 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0034_object_type_definition_with_missing_transitive_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node & Resource { 2 | name: String 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource { 10 | width: Int 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0035_object_type_definition_with_missing_implements_interfaces_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Image { 2 | name: String 3 | id: ID! 4 | url: String 5 | width: Int 6 | thumbnail: String 7 | } 8 | 9 | interface Node { 10 | id: ID! 11 | } 12 | 13 | interface Resource implements Node { 14 | id: ID! 15 | url: String 16 | width: Int 17 | } 18 | 19 | interface Image implements Resource { 20 | id: ID! 21 | url: String 22 | width: Int 23 | thumbnail: String 24 | } 25 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0038_object_type_with_undefined_field_type.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | width: Int 3 | img: Url 4 | relationship: Person 5 | } 6 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0039_interface_with_undefined_field_type.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | width: Int 3 | img: Url 4 | } 5 | 6 | interface Connection { 7 | relationship: Person 8 | } 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0041_subscription_operation_with_undefined_fields.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | undefinedSubscriptionField 3 | } 4 | 5 | type Subscription { 6 | newMessage: Result 7 | } 8 | 9 | type Result { 10 | body: String 11 | sender: String 12 | } 13 | 14 | type Query { 15 | message: String 16 | } 17 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0042_mutation_operation_with_undefined_fields.graphql: -------------------------------------------------------------------------------- 1 | mutation adoptAPetMutation { 2 | undefinedMutationField 3 | } 4 | 5 | type Query { 6 | name: String 7 | age: Int 8 | } 9 | 10 | type Mutation { 11 | addPet(name: String!, petType: PetType): Result! 12 | } 13 | 14 | type Result { 15 | id: String 16 | } 17 | 18 | enum PetType { 19 | CAT 20 | DOG 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0043_undefined_union_member.graphql: -------------------------------------------------------------------------------- 1 | interface Pet { 2 | name: String 3 | } 4 | 5 | type Dog implements Pet { 6 | name: String 7 | nickname: String 8 | barkVolume: Int 9 | } 10 | 11 | union CatOrDog = Cat | Dog 12 | 13 | type Human { 14 | name: String 15 | pets: [Pet] 16 | } 17 | 18 | type Query { 19 | human: Human 20 | } 21 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0044_union_member_not_of_object_type.graphql: -------------------------------------------------------------------------------- 1 | interface Pet { 2 | name: String 3 | } 4 | 5 | type Cat implements Pet { 6 | name: String 7 | nickname: String 8 | meowVolume: Int 9 | } 10 | 11 | type Dog implements Pet { 12 | name: String 13 | nickname: String 14 | barkVolume: Int 15 | } 16 | 17 | union CatOrDog = Cat | Pet 18 | 19 | type Human { 20 | name: String 21 | pets: [Pet] 22 | } 23 | 24 | type Query { 25 | human: Human 26 | } 27 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0046_duplicate_directive_arguments.graphql: -------------------------------------------------------------------------------- 1 | scalar newScalar @specifiedBy(url: "https://tools.ietf.org/html/rfc4122", url: "https://tools.ietf.org/html/rfc4125") 2 | 3 | type Query { 4 | status: String 5 | response: String @example(if: false, if: true) 6 | } 7 | 8 | directive @example(if: Boolean) on FIELD_DEFINITION 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0047_duplicate_field_arguments.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | single(arg: Boolean): Int 3 | } 4 | 5 | query GetDuplicate { 6 | single(arg: true, arg: false) 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0048_duplicate_field_argument_definition_names.graphql: -------------------------------------------------------------------------------- 1 | interface Duplicate { 2 | duplicate(arg: Boolean, arg: Boolean): Int 3 | } 4 | 5 | type Query implements Duplicate { 6 | single(arg: Boolean): Int 7 | duplicate(arg: Boolean, arg: Boolean): Int 8 | } 9 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0049_duplicate_directive_argument_definition_names.graphql: -------------------------------------------------------------------------------- 1 | directive @example(arg: Boolean, arg: Boolean) on FIELD 2 | 3 | type Query { 4 | x: Int 5 | } 6 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0051_subscription_operation_with_root_introspection_field.graphql: -------------------------------------------------------------------------------- 1 | subscription sub { 2 | __typename 3 | } 4 | 5 | type Subscription { 6 | __typename: String 7 | } 8 | 9 | type Query { 10 | x: Int 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0052_undefined_directive.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | status: Int @directiveA 4 | } 5 | 6 | directive @directiveB on FIELD_DEFINITION 7 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0053_argument_name_is_not_defined.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | field(arg1: Int): Int 3 | item: Field 4 | } 5 | 6 | type Field { 7 | field(arg4: Int): Int 8 | } 9 | 10 | fragment X on Field { 11 | field(arg4: 1, arg2: 2, arg3: 3) 12 | } 13 | 14 | query field { 15 | field(arg2: 3) 16 | } 17 | 18 | query fieldWithFragment { 19 | item { 20 | ...X 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0055_duplicate_variable_definitions.graphql: -------------------------------------------------------------------------------- 1 | query houseTrainedQuery($atOtherHomes: Boolean, $atOtherHomes: Boolean) { 2 | dog { 3 | isHouseTrained(atOtherHomes: $atOtherHomes) 4 | } 5 | } 6 | 7 | type Query { 8 | dog: Dog 9 | } 10 | 11 | type Dog { 12 | name: String! 13 | nickname: String 14 | barkVolume: Int 15 | isHouseTrained(atOtherHomes: Boolean): Boolean! 16 | } 17 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0057_duplicate_type_names.graphql: -------------------------------------------------------------------------------- 1 | interface World { 2 | a: Int 3 | } 4 | 5 | type Object implements World { 6 | a: Int 7 | } 8 | 9 | type World implements World { 10 | a: Int 11 | } 12 | 13 | scalar X @specifiedBy(url: "https://apollographql.com") 14 | 15 | union X @X = Object 16 | 17 | enum X { 18 | Y 19 | Z 20 | } 21 | 22 | type X { 23 | x: X 24 | } 25 | 26 | directive @X(ok: Boolean) on UNION 27 | 28 | type Query { 29 | x: Int 30 | } 31 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0058_fragment_definitions_with_duplicate_names.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Pet 3 | } 4 | 5 | type Pet { 6 | name: String! 7 | owner: String 8 | } 9 | 10 | query getPet { 11 | pet { 12 | name 13 | ...petFragment 14 | } 15 | } 16 | 17 | fragment petFragment on Pet { 18 | name 19 | owner 20 | } 21 | 22 | fragment petFragment on Pet { 23 | name 24 | owner 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0059_root_operation_object_type.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: SomeInterface 3 | } 4 | 5 | interface SomeInterface { 6 | name: String 7 | } 8 | 9 | type ShouldBeTheQuery { 10 | name: String 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0060_root_operation_definition_undefined_operation_type.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: SomeQuery 3 | } 4 | 5 | type ShouldBeTheQuery { 6 | name: String 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0061_root_operation_with_default_undefined_query.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: Query 3 | } 4 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0062_root_operation_with_list.graphql: -------------------------------------------------------------------------------- 1 | schema {} 2 | 3 | type Object { 4 | field: Int 5 | } 6 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0063_extension_orphan.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | x: Int 3 | } 4 | 5 | extend scalar A @deprecated(reason: "Use B instead") 6 | 7 | extend type B { 8 | field: Int! 9 | } 10 | 11 | extend schema { 12 | query: Query 13 | } 14 | 15 | extend union C = String 16 | 17 | extend interface D { 18 | field: Int 19 | } 20 | 21 | extend input E { 22 | field: Int 23 | } 24 | 25 | extend enum F { 26 | MEMBER 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0065_subselection_of_enum.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfEnum { 2 | pet1 { 3 | name 4 | } 5 | pet2 { 6 | name 7 | } 8 | pet3 { 9 | name 10 | } 11 | pet4 { 12 | name 13 | } 14 | pet5 { 15 | name 16 | } 17 | pet6 { 18 | name 19 | } 20 | } 21 | 22 | type Query { 23 | pet1: Pet 24 | pet2: Pet! 25 | pet3: [Pet] 26 | pet4: [Pet!] 27 | pet5: [Pet]! 28 | pet6: [Pet!]! 29 | } 30 | 31 | enum Pet { 32 | CAT 33 | DOG 34 | FOX 35 | } 36 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0066_subselection_of_scalar.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfScalar { 2 | url1 { 3 | name 4 | } 5 | url2 { 6 | name 7 | } 8 | url3 { 9 | name 10 | } 11 | url4 { 12 | name 13 | } 14 | url5 { 15 | name 16 | } 17 | url6 { 18 | name 19 | } 20 | } 21 | 22 | type Query { 23 | url1: URL 24 | url2: URL! 25 | url3: [URL] 26 | url4: [URL!] 27 | url5: [URL]! 28 | url6: [URL!]! 29 | } 30 | 31 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 32 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0067_subselection_of_interface.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfInterface { 2 | pet1 3 | pet2 4 | pet3 5 | pet4 6 | pet5 7 | pet6 8 | } 9 | 10 | type Query { 11 | pet1: Pet 12 | pet2: Pet! 13 | pet3: [Pet] 14 | pet4: [Pet!] 15 | pet5: [Pet]! 16 | pet6: [Pet!]! 17 | } 18 | 19 | interface Pet { 20 | id: String 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0068_subselection_of_union.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfUnion { 2 | pet1 3 | pet2 4 | pet3 5 | pet4 6 | pet5 7 | pet6 8 | } 9 | 10 | type Query { 11 | pet1: CatOrDog 12 | pet2: CatOrDog! 13 | pet3: [CatOrDog] 14 | pet4: [CatOrDog!] 15 | pet5: [CatOrDog]! 16 | pet6: [CatOrDog!]! 17 | } 18 | 19 | type Cat { 20 | id: String! 21 | } 22 | 23 | type Dog { 24 | id: String! 25 | } 26 | 27 | union CatOrDog = Cat | Dog 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0069_subselection_of_object.graphql: -------------------------------------------------------------------------------- 1 | query SelectionOfObject { 2 | pet1 3 | pet2 4 | pet3 5 | pet4 6 | pet5 7 | pet6 8 | } 9 | 10 | type Query { 11 | pet1: Pet 12 | pet2: Pet! 13 | pet3: [Pet] 14 | pet4: [Pet!] 15 | pet5: [Pet]! 16 | pet6: [Pet!]! 17 | } 18 | 19 | type Pet { 20 | id: String 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0074_merge_identical_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Dog 3 | } 4 | 5 | type Dog { 6 | nickname: String 7 | name: String! 8 | } 9 | 10 | query queryPupper { 11 | pet { 12 | ...conflictingBecauseAlias 13 | ...sameAliasesWithDifferentFieldTargets 14 | } 15 | } 16 | 17 | fragment conflictingBecauseAlias on Dog { 18 | name: nickname 19 | name 20 | } 21 | 22 | fragment sameAliasesWithDifferentFieldTargets on Dog { 23 | fido: name 24 | fido: nickname 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0077_merge_conflict_deep.graphql: -------------------------------------------------------------------------------- 1 | type O { 2 | a: Int 3 | b: Int 4 | } 5 | 6 | type Query { 7 | field: O 8 | } 9 | 10 | query { 11 | field { 12 | x: a 13 | } 14 | field { 15 | x: b 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0078_merge_conflict_nested_fragments.graphql: -------------------------------------------------------------------------------- 1 | type T { 2 | a: Int 3 | b: Int 4 | c: Int 5 | d: Int 6 | } 7 | 8 | type Query { 9 | field: T 10 | } 11 | 12 | query { 13 | field { 14 | ...F 15 | } 16 | field { 17 | ...I 18 | } 19 | } 20 | 21 | fragment F on T { 22 | x: a 23 | ...G 24 | } 25 | 26 | fragment G on T { 27 | y: c 28 | } 29 | 30 | fragment I on T { 31 | y: d 32 | ...J 33 | } 34 | 35 | fragment J on T { 36 | x: b 37 | } 38 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0079_directive_is_unique.graphql: -------------------------------------------------------------------------------- 1 | directive @repeatable repeatable on FIELD 2 | 3 | directive @unique on FIELD 4 | 5 | type Query { 6 | fieldA: Int 7 | fieldB: Int 8 | } 9 | 10 | query { 11 | fieldA @repeatable @repeatable 12 | fieldB @unique @unique 13 | } 14 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0082_introspection_types_in_mutation.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: MyQueryRootType 3 | mutation: MyMutationRootType 4 | } 5 | 6 | type MyQueryRootType { 7 | someField: String 8 | } 9 | 10 | type MyMutationRootType { 11 | setSomeField(to: String): String 12 | } 13 | 14 | mutation introspect { 15 | __type(name: "User") { 16 | name 17 | fields { 18 | name 19 | type { 20 | name 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0084_circular_non_nullable_input_objects.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | example(arg: First): Int 4 | } 5 | 6 | input First { 7 | second: Second! 8 | value: String 9 | } 10 | 11 | input Second { 12 | third: Third! 13 | value: String 14 | } 15 | 16 | input Third { 17 | fourth: Fourth! 18 | value: String 19 | } 20 | 21 | input Fourth { 22 | first: First! 23 | } 24 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0085_fragment_spread_target_defined.graphql: -------------------------------------------------------------------------------- 1 | type Dog { 2 | name: String! 3 | } 4 | 5 | type Query { 6 | dog: Dog 7 | } 8 | 9 | query { 10 | dog { 11 | ...undefinedFragment 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0086_unused_fragment.graphql: -------------------------------------------------------------------------------- 1 | query Query { 2 | products { 3 | inStock 4 | name 5 | } 6 | } 7 | 8 | type Query { 9 | products: Product 10 | } 11 | 12 | type Product { 13 | inStock: Boolean 14 | name: String 15 | } 16 | 17 | fragment nameFragment on Product { 18 | name 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0088_fragment_selection_set.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | topProducts: Product 4 | } 5 | 6 | type Product { 7 | inStock: Boolean 8 | name: String 9 | } 10 | 11 | query getProduct { 12 | name 13 | topProduct { 14 | ...productFragment 15 | } 16 | topProducts { 17 | ...productFragment 18 | } 19 | } 20 | 21 | fragment productFragment on Product { 22 | notExistingField 23 | } 24 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0091_recursive_interface_definition.graphql: -------------------------------------------------------------------------------- 1 | interface A implements B { 2 | name: String 3 | } 4 | 5 | interface B implements A { 6 | name: String 7 | } 8 | 9 | type Impl implements A & B { 10 | name: String 11 | } 12 | 13 | type Query { 14 | get: A 15 | } 16 | 17 | fragment recursive on A { 18 | name 19 | } 20 | 21 | query { 22 | get { 23 | ...recursive 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0093_fragment_validation_with_recursive_type_system.graphql: -------------------------------------------------------------------------------- 1 | interface A implements B { 2 | a: A 3 | b: B 4 | } 5 | 6 | interface B implements A { 7 | a: A 8 | b: B 9 | } 10 | 11 | type C implements A & B { 12 | a: A 13 | b: B 14 | value: Int! 15 | } 16 | 17 | type Query { 18 | c: C 19 | } 20 | 21 | fragment b on C { 22 | value 23 | } 24 | 25 | query { 26 | c { 27 | ...b 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0095_interface_implementation_declared_once.graphql: -------------------------------------------------------------------------------- 1 | interface Intf { 2 | field: String 3 | } 4 | 5 | type Object implements Intf & Intf { 6 | field: String 7 | } 8 | 9 | type Extended implements Intf { 10 | field: String 11 | } 12 | 13 | extend type Extended implements Intf 14 | 15 | interface SubIntf implements Intf & Intf { 16 | field: String 17 | } 18 | 19 | type Query { 20 | x: Int 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0096_schema_extensions.graphql: -------------------------------------------------------------------------------- 1 | directive @nonRepeatable on SCHEMA 2 | 3 | type Query { 4 | viewCount: Int! 5 | } 6 | 7 | schema @nonRepeatable { 8 | query: Query 9 | } 10 | 11 | extend schema @nonRepeatable 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0097_enum_extensions.graphql: -------------------------------------------------------------------------------- 1 | directive @nonRepeatable on ENUM 2 | 3 | enum E { 4 | MEMBER_1 5 | MEMBER_2 6 | } 7 | 8 | extend enum E @nonRepeatable { 9 | MEMBER_3 10 | MEMBER_4 11 | } 12 | 13 | extend enum E @nonRepeatable { 14 | MEMBER_2 15 | MEMBER_4 16 | } 17 | 18 | type Query { 19 | x: Int 20 | } 21 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0099_input_object_extensions.graphql: -------------------------------------------------------------------------------- 1 | input UniqueNames { 2 | field: String 3 | } 4 | 5 | extend input UniqueNames { 6 | field: String 7 | } 8 | 9 | directive @nonRepeatable on INPUT_OBJECT 10 | 11 | input UniqueDirective @nonRepeatable { 12 | field: String 13 | } 14 | 15 | extend input UniqueDirective @nonRepeatable 16 | 17 | type Query { 18 | x: Int 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0103_invalid_directive_on_input_value.graphql: -------------------------------------------------------------------------------- 1 | directive @example(arg: String!) on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION 2 | 3 | input Input { 4 | key: String! @example 5 | } 6 | 7 | directive @directive( 8 | arg2: Int @example, 9 | ) on SCHEMA 10 | 11 | type Query { 12 | x: Int 13 | } 14 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0103_invalid_type_in_arg.graphql: -------------------------------------------------------------------------------- 1 | scalar AnInputType @specifiedBy(url: "http://example.com") 2 | 3 | type OutputType { 4 | not: AnInputType 5 | } 6 | 7 | input InputObjectWithOutputType { 8 | thisIsWrong: OutputType 9 | } 10 | 11 | type Root { 12 | id: ID! 13 | undefinedTypes(a: number, b: number): OperationResult! 14 | outputTypes(a: OutputType, b: OperationResult): ID! 15 | } 16 | 17 | union OperationResult = Operation 18 | 19 | type Operation { 20 | id: ID! 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0105_executable_definition_in_type_system_document.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | field: Int 3 | } 4 | 5 | query { 6 | field 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0106_type_system_definition_in_executable_document.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | field: Int 3 | } 4 | 5 | query { 6 | field 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0108_implicit_schema_extension.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | 5 | extend schema { 6 | query: Query 7 | } 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0109_null_in_list_issue_738.graphql: -------------------------------------------------------------------------------- 1 | scalar CustomScalar @specifiedBy(url: "https://example.com") 2 | 3 | input WithList { 4 | list: [String!] 5 | } 6 | 7 | type Query { 8 | foo(arg: [CustomScalar!]!): String! 9 | bar(arg: [String!]): String! 10 | list(arg: WithList): String! 11 | } 12 | 13 | query { 14 | a: foo(arg: [null, 1]) 15 | b: foo(arg: [null, null, "hello"]) 16 | bar(arg: [null]) 17 | list(arg: {list: ["ok", null]}) 18 | } 19 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0110_list_usage_in_non_list_type.graphql: -------------------------------------------------------------------------------- 1 | scalar CustomScalar @specifiedBy(url: "https://example.com") 2 | 3 | input Args { 4 | ok: CustomScalar 5 | int: Int! 6 | str: String! 7 | bool: Boolean! 8 | opt: Int 9 | id: ID! 10 | list: [Int] 11 | } 12 | 13 | type Query { 14 | field(args: Args): String! 15 | } 16 | 17 | query { 18 | field(args: {ok: [1, "2", 3, []], int: [1, 2, 3], str: ["1"], bool: [true, false], opt: [1, 2, 3], id: [1, "2", 3], list: [1, 2, 3]}) 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0111_const_value.graphql: -------------------------------------------------------------------------------- 1 | query($var1: Boolean!, $var2: Boolean! = $var1) { 2 | f1 @include(if: $var1) 3 | f2 @include(if: $var2) 4 | } 5 | 6 | directive @someDir(arg: Boolean) on OBJECT 7 | 8 | type Query @someDir(arg: $var1) { 9 | f1: Int 10 | f2: Int 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0112_anonymous_subscription_with_multiple_root_fields.graphql: -------------------------------------------------------------------------------- 1 | subscription { 2 | newMessage { 3 | body 4 | sender 5 | } 6 | disallowedSecondRootField 7 | } 8 | 9 | type Subscription { 10 | newMessage: Result 11 | disallowedSecondRootField: String 12 | } 13 | 14 | type Result { 15 | body: String 16 | sender: String 17 | } 18 | 19 | type Query { 20 | message: String 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0114_interface_definition_with_missing_fields.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on INTERFACE 2 | 3 | type Query { 4 | foo: Node 5 | } 6 | 7 | interface Node 8 | 9 | extend interface Node @foo 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0115_object_definition_with_missing_fields.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on OBJECT 2 | 3 | directive @bar on OBJECT 4 | 5 | type Query { 6 | foo: User 7 | } 8 | 9 | type User @foo 10 | 11 | extend type User @bar 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0116_enum_definition_with_missing_values.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on ENUM 2 | 3 | type Query { 4 | foo: WEEKDAY 5 | } 6 | 7 | enum WEEKDAY 8 | 9 | extend enum WEEKDAY @foo 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0117_union_definition_with_missing_members.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on UNION 2 | 3 | type Query { 4 | foo: Search 5 | } 6 | 7 | union Search 8 | 9 | extend union Search @foo 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0118_input_object_definition_with_missing_values.graphql: -------------------------------------------------------------------------------- 1 | directive @foo on INPUT_OBJECT 2 | 3 | type Query { 4 | foo(id: In): String 5 | } 6 | 7 | input In 8 | 9 | extend input In @foo 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0119_reserved_named.graphql: -------------------------------------------------------------------------------- 1 | directive @__Prime on SCHEMA 2 | 3 | schema @__Prime { 4 | query: __MyQuery 5 | } 6 | 7 | type __MyQuery { 8 | __secretField(__heatedArgument: __In): Int 9 | } 10 | 11 | input __In { 12 | __amount: __BigInt 13 | } 14 | 15 | scalar __BigInt 16 | 17 | enum __Maybe { 18 | __Yes 19 | __No 20 | } 21 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0119_reserved_names.graphql: -------------------------------------------------------------------------------- 1 | directive @__Prime(__if: Boolean!) on SCHEMA 2 | 3 | schema @__Prime(__if: true) { 4 | query: __MyQuery 5 | } 6 | 7 | type __MyQuery { 8 | __secretField(__heatedArgument: __In): Int 9 | } 10 | 11 | input __In { 12 | __amount: __BigInt 13 | } 14 | 15 | scalar __BigInt 16 | 17 | enum __Maybe { 18 | Yes 19 | No 20 | __FileNotFound 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0120_conditional_subscriptions.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalSub($condition: Boolean = true) { 2 | ticker @include(if: $condition) 3 | } 4 | 5 | type Query { 6 | hello: String 7 | } 8 | 9 | type Subscription { 10 | ticker: String 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0121_conditional_subscriptions_with_inline_fragment.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ... @include(if: $condition) { 3 | ticker 4 | } 5 | } 6 | 7 | type Query { 8 | hello: String 9 | } 10 | 11 | type Subscription { 12 | ticker: String 13 | } 14 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0121_conditional_subscriptions_with_inline_fragments.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ... @include(if: $condition) { 3 | ticker 4 | } 5 | } 6 | 7 | type Query { 8 | hello: String 9 | } 10 | 11 | type Subscription { 12 | ticker: String 13 | } 14 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0122_conditional_subscriptions_with_named_fragment.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ...mySubscription @include(if: $condition) 3 | } 4 | 5 | fragment mySubscription on Subscription { 6 | ticker 7 | } 8 | 9 | type Query { 10 | hello: String 11 | } 12 | 13 | type Subscription { 14 | ticker: String 15 | } 16 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0123_conditional_subscriptions_inside_inline_fragment.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ... { 3 | ticker @include(if: $condition) 4 | } 5 | } 6 | 7 | type Query { 8 | hello: String 9 | } 10 | 11 | type Subscription { 12 | ticker: String 13 | } 14 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/diagnostics/0124_conditional_subscriptions_inside_named_fragment.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalInlineSub($condition: Boolean = true) { 2 | ...mySubscription 3 | } 4 | 5 | fragment mySubscription on Subscription { 6 | ticker @include(if: $condition) 7 | } 8 | 9 | type Query { 10 | hello: String 11 | } 12 | 13 | type Subscription { 14 | ticker: String 15 | } 16 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0001_annonymous_operation_definition.graphql: -------------------------------------------------------------------------------- 1 | { 2 | cat { 3 | name 4 | } 5 | } 6 | 7 | type Query { 8 | cat: Pet 9 | } 10 | 11 | type Pet { 12 | name: String 13 | } 14 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0002_multiple_named_operation_definitions.graphql: -------------------------------------------------------------------------------- 1 | query getCatName { 2 | cat { 3 | name 4 | } 5 | } 6 | 7 | query getOwnerName { 8 | cat { 9 | owner { 10 | name 11 | } 12 | } 13 | } 14 | 15 | type Query { 16 | cat: Pet 17 | } 18 | 19 | type Pet { 20 | name: String 21 | owner: PetOwner 22 | } 23 | 24 | type PetOwner { 25 | name: String 26 | } 27 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0004_schema_with_custom_scalars.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | website: URL 3 | amount: Int 4 | } 5 | 6 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 7 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0005_schema_with_valid_enum_definitions.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Pet 3 | snacks: Snack 4 | } 5 | 6 | enum Pet { 7 | CAT 8 | DOG 9 | FOX 10 | } 11 | 12 | enum Snack { 13 | THRIVE_PET_FOODS 14 | LILYS_KITCHEN 15 | ACANA 16 | } 17 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0006_schema_with_valid_union.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: SearchQuery 3 | } 4 | 5 | union SearchResult = Photo | Person 6 | 7 | type Person { 8 | name: String 9 | age: Int 10 | } 11 | 12 | type Photo { 13 | height: Int 14 | width: Int 15 | } 16 | 17 | type SearchQuery { 18 | firstSearchResult: SearchResult 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0007_schema_with_interface_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query implements Node { 2 | id: ID! 3 | } 4 | 5 | interface Node { 6 | id: ID! 7 | } 8 | 9 | interface Resource implements Node { 10 | id: ID! 11 | width: Int 12 | height: Int 13 | } 14 | 15 | interface Image implements Resource & Node { 16 | id: ID! 17 | width: Int 18 | height: Int 19 | thumbnail: String 20 | } 21 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0008_schema_with_directive_definition.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | literature: Book 3 | } 4 | 5 | directive @delegateField(name: String!) repeatable on OBJECT | INTERFACE 6 | 7 | type Book @delegateField(name: "pageCount") @delegateField(name: "author") { 8 | id: ID! 9 | } 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0009_schema_with_input_object.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | website: URL 3 | amount: Int 4 | } 5 | 6 | scalar URL @specifiedBy(url: "https://tools.ietf.org/html/rfc3986") 7 | 8 | input Point2D { 9 | x: Float 10 | y: Float 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0011_fragment_spreads_in_fragment_definitions.graphql: -------------------------------------------------------------------------------- 1 | query IntrospectionQuery { 2 | foo { 3 | ...Bar 4 | } 5 | } 6 | 7 | fragment Bar on Foo { 8 | baz { 9 | ...Quux 10 | } 11 | } 12 | 13 | fragment Quux on Baz { 14 | id 15 | } 16 | 17 | type Query { 18 | foo: Foo 19 | } 20 | 21 | type Foo { 22 | baz: Baz 23 | } 24 | 25 | type Baz { 26 | id: ID 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0014_float_values.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name(arg: WithAllKindsOfFloats): String 3 | } 4 | 5 | input WithAllKindsOfFloats { 6 | a_regular_float: Float = 1.2 7 | an_integer_float: Float = 1234 8 | a_float_that_doesnt_fit_an_int: Float = 9876543210 9 | list_of_floats: [Float] = [ 10 | 4, 11 | 9876543210, 12 | 98765432109876543210, 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0018_non_clashing_names.graphql: -------------------------------------------------------------------------------- 1 | type A @A { 2 | a: Int 3 | } 4 | 5 | type Query { 6 | a: A 7 | } 8 | 9 | directive @A on OBJECT 10 | 11 | fragment A on A { 12 | a 13 | } 14 | 15 | query A { 16 | a { 17 | ...A 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0020_merge_identical_fields.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | pet: Dog 3 | } 4 | 5 | type Dog { 6 | nickname: String 7 | name: String! 8 | } 9 | 10 | query queryPupper { 11 | pet { 12 | ...mergeIdenticalFields 13 | ...mergeIdenticalAliasesAndFields 14 | } 15 | } 16 | 17 | fragment mergeIdenticalFields on Dog { 18 | name 19 | name 20 | } 21 | 22 | fragment mergeIdenticalAliasesAndFields on Dog { 23 | otherName: name 24 | otherName: name 25 | } 26 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0025_unique_directives.graphql: -------------------------------------------------------------------------------- 1 | directive @repeatable repeatable on FIELD 2 | 3 | directive @unique on FIELD 4 | 5 | type Query { 6 | field: Int 7 | } 8 | 9 | query { 10 | field @repeatable @repeatable 11 | field @unique 12 | field @unique 13 | } 14 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0026_type_introspection.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | id: String 3 | name: String 4 | birthday: Date 5 | } 6 | 7 | scalar Date @specifiedBy(url: "datespec.com") 8 | 9 | query { 10 | __type(name: "User") { 11 | name 12 | fields { 13 | name 14 | type { 15 | name 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0027_typename_introspection_in_object.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | id: String 3 | name: String 4 | birthday: Date 5 | } 6 | 7 | scalar Date @specifiedBy(url: "datespec.com") 8 | 9 | query { 10 | name 11 | __typename 12 | } 13 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0028_typename_introspection_in_union.graphql: -------------------------------------------------------------------------------- 1 | union SearchResult = Photo | Person 2 | 3 | type Person { 4 | name: String 5 | age: Int 6 | } 7 | 8 | type Photo { 9 | height: Int 10 | width: Int 11 | } 12 | 13 | type Query { 14 | firstSearchResult: SearchResult 15 | } 16 | 17 | query { 18 | firstSearchResult { 19 | __typename 20 | ... on Person { 21 | name 22 | } 23 | ... on Photo { 24 | height 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0029_used_variable_in_list_and_input.graphql: -------------------------------------------------------------------------------- 1 | type Product { 2 | attributes(includeNames: [String!]): [String!] 3 | } 4 | 5 | input Opts { 6 | prop: [[Int]!]! 7 | } 8 | 9 | type Query { 10 | field(opts: Opts): [Product] 11 | } 12 | 13 | query($attributeName: String!, $v: Int) { 14 | field(opts: {prop: [[2], [$v], [4]]}) { 15 | attributes(includeNames: [$attributeName]) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0030_cyclical_nullable_input_objects.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | example(arg: First): Int 4 | } 5 | 6 | input First { 7 | second: Second 8 | value: String 9 | } 10 | 11 | input Second { 12 | third: [Third!]! 13 | value: String 14 | } 15 | 16 | input Third { 17 | fourth: Fourth 18 | value: String 19 | } 20 | 21 | input Fourth { 22 | first: First 23 | } 24 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0034_built_in_directive_redefinition.graphql: -------------------------------------------------------------------------------- 1 | schema @deprecated(reason: "The person who got promoted by shipping this product has moved on to another team.\nThe service will shut down next month.") { 2 | query: Query 3 | } 4 | 5 | type Query { 6 | importantData: Int 7 | } 8 | 9 | directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE | SCHEMA 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0035_implicit_schema_definition_with_query_type.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0036_implicit_schema_definition_with_several_default_types.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | 5 | type Mutation { 6 | add(name: String!): Result! 7 | } 8 | 9 | type Result { 10 | id: String 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0037_implicit_schema_extension_with_directive.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | name: String 3 | } 4 | 5 | extend schema @dir 6 | 7 | directive @dir on SCHEMA 8 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0038_argument_default.graphql: -------------------------------------------------------------------------------- 1 | directive @defer(label: String, if: Boolean! = true) on FRAGMENT_SPREAD | INLINE_FRAGMENT 2 | 3 | type Query { 4 | guitarAmp(upTo: Int! = 11): String 5 | } 6 | 7 | query { 8 | ... @defer { 9 | guitarAmp 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0041_unquoted_string_for_custom_scalar.graphql: -------------------------------------------------------------------------------- 1 | scalar Currency 2 | 3 | type Query { 4 | convertToUSD(amount: Int!, currency: Currency!): Int! 5 | } 6 | 7 | query { 8 | convertToUSD(amount: 100, currency: EUR) 9 | } 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0115_interface_definition_with_extension_defines_field.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | foo: Node 3 | } 4 | 5 | interface Node 6 | 7 | extend interface Node { 8 | bar: String 9 | } 10 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0116_interface_without_implementations.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | intf: Intf 3 | } 4 | 5 | interface Intf { 6 | field: Int 7 | } 8 | 9 | query SelectDirectly { 10 | intf { 11 | field 12 | } 13 | } 14 | 15 | query UsingInlineFragment { 16 | intf { 17 | ... on Intf { 18 | field 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/test_data/serializer/ok/0117_subscription_conditions_not_at_root.graphql: -------------------------------------------------------------------------------- 1 | subscription ConditionalSub($includeContent: Boolean = true, $small: Boolean = true) { 2 | messages { 3 | username 4 | text @include(if: $includeContent) 5 | avatar @skip(if: $small) 6 | } 7 | } 8 | 9 | type Query { 10 | hello: String 11 | } 12 | 13 | type Message { 14 | username: String 15 | text: String 16 | avatar: String 17 | } 18 | 19 | type Subscription { 20 | messages: Message 21 | } 22 | -------------------------------------------------------------------------------- /crates/apollo-compiler/tests/main.rs: -------------------------------------------------------------------------------- 1 | mod executable; 2 | mod extensions; 3 | mod field_set; 4 | mod field_type; 5 | mod introspection; 6 | mod introspection_max_depth; 7 | mod locations; 8 | mod merge_schemas; 9 | /// Formerly in src/lib.rs 10 | mod misc; 11 | mod name; 12 | mod parser; 13 | mod schema; 14 | mod serde; 15 | mod validation; 16 | 17 | #[path = "../examples/rename.rs"] 18 | mod rename; 19 | -------------------------------------------------------------------------------- /crates/apollo-compiler/tests/name.rs: -------------------------------------------------------------------------------- 1 | use apollo_compiler::Name; 2 | 3 | /// cargo +nightly miri test --test main -- name::smoke_test 4 | #[test] 5 | fn smoke_test() { 6 | let heap = Name::new("abc").unwrap(); 7 | let static_ = Name::new_static("abc").unwrap(); 8 | let heap_2 = heap.clone(); 9 | let static_2 = static_.clone(); 10 | assert_eq!(heap_2.as_str(), static_2.as_str()); 11 | assert_eq!(heap_2, static_2); 12 | } 13 | -------------------------------------------------------------------------------- /crates/apollo-parser/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/apollo-parser/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /crates/apollo-parser/screenshots/apollo_parser_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apollographql/apollo-rs/70aba3ffcafdeb892b9791c1bfed86ff928dc2f6/crates/apollo-parser/screenshots/apollo_parser_error.png -------------------------------------------------------------------------------- /crates/apollo-parser/src/cst/generated/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod nodes; 2 | -------------------------------------------------------------------------------- /crates/apollo-parser/src/parser/grammar/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod document; 2 | pub(crate) mod selection; 3 | pub(crate) mod ty; 4 | 5 | mod argument; 6 | mod description; 7 | mod directive; 8 | mod enum_; 9 | mod extensions; 10 | mod field; 11 | mod fragment; 12 | mod input; 13 | mod interface; 14 | mod name; 15 | mod object; 16 | mod operation; 17 | mod scalar; 18 | mod schema; 19 | mod union_; 20 | mod value; 21 | mod variable; 22 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0001_unterminated_spread_operator_with_one.graphql: -------------------------------------------------------------------------------- 1 | . -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0001_unterminated_spread_operator_with_one.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:1 "Unterminated spread operator" . 2 | EOF@1:1 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0002_unterminated_spread_operator_with_2.graphql: -------------------------------------------------------------------------------- 1 | .. -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0002_unterminated_spread_operator_with_2.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:2 "Unterminated spread operator" .. 2 | EOF@2:2 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0003_float_with_incorrect_decimal_point.graphql: -------------------------------------------------------------------------------- 1 | 456E34.54 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0003_float_with_incorrect_decimal_point.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:7 "Unexpected character `.` as float suffix" 456E34. 2 | INT@7:9 "54" 3 | EOF@9:9 4 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0004_unterminated_string_value.graphql: -------------------------------------------------------------------------------- 1 | " -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0004_unterminated_string_value.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:1 "unexpected end of data while lexing string value" " 2 | EOF@1:1 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0005_escaped_char.graphql: -------------------------------------------------------------------------------- 1 | { 2 | sku: "\a invalidly escaped" 3 | stringValue: "\"properly escaped\"" 4 | name: "\invalidly escaped\"" 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0006_unterminated_string_value_in_list_value_argument.graphql: -------------------------------------------------------------------------------- 1 | extend schema 2 | @link(url: "https://specs.apollo.dev/federation/v2.0", 3 | import: ["@key", "@external]) 4 | 5 | type Vehicle @key(fields: "id") { 6 | id: ID!, 7 | type: String, 8 | modelCode: String, 9 | brandName: String, 10 | launchDate: String 11 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0007_unterminated_string_value_in_object_value_argument.graphql: -------------------------------------------------------------------------------- 1 | mutation { 2 | createStore(draft: { 3 | name: [{ locale: "en", value: "my store }] 4 | }) { 5 | name(locale: "en") 6 | } 7 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0008_unterminated_string_value.graphql: -------------------------------------------------------------------------------- 1 | mutation { 2 | createstore { 3 | name(locale: "en) 4 | } 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0008_unterminated_string_value.txt: -------------------------------------------------------------------------------- 1 | NAME@0:8 "mutation" 2 | WHITESPACE@8:9 " " 3 | L_CURLY@9:10 "{" 4 | WHITESPACE@10:13 "\n " 5 | NAME@13:24 "createstore" 6 | WHITESPACE@24:25 " " 7 | L_CURLY@25:26 "{" 8 | WHITESPACE@26:31 "\n " 9 | NAME@31:35 "name" 10 | L_PAREN@35:36 "(" 11 | NAME@36:42 "locale" 12 | COLON@42:43 ":" 13 | WHITESPACE@43:44 " " 14 | ERROR@44:54 "unterminated string value" "en) 15 | } 16 | } 17 | EOF@54:54 18 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0009_unterminated_string_value_as_default.graphql: -------------------------------------------------------------------------------- 1 | type Person { 2 | name: String 3 | picture(url: String = "https://spec.graphql.org/October2021/#DefaultValue): Url 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0010_unterminated_string_value_with_unicode.graphql: -------------------------------------------------------------------------------- 1 | "hello✨ -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0010_unterminated_string_value_with_unicode.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:9 "unterminated string value" "hello✨ 2 | EOF@9:9 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0011_unterminated_string_value_with_unicode_and_escaped_characters.graphql: -------------------------------------------------------------------------------- 1 | "\n\n\\u{c}\nPSK\\u{1}\\0\\0\\0י -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0011_unterminated_string_value_with_unicode_and_escaped_characters.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:33 "unterminated string value" "\n\n\\u{c}\nPSK\\u{1}\\0\\0\\0י 2 | EOF@33:33 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0012_string_value_with_line_terminators.graphql: -------------------------------------------------------------------------------- 1 | " 2 | hello 3 | " -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0012_string_value_with_line_terminators.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:9 "unexpected line terminator" " 2 | hello 3 | " 4 | EOF@9:9 5 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0013_string_with_invalid_escapes.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | "This is \"\"a test \a\d\q description" 3 | invalidPlainEscape: String 4 | "\u008" 5 | incompleteUnicodeEscape: String 6 | "\uF" 7 | incompleteUnicodeEscape2: String 8 | "\uzzzz" 9 | invalidUnicodeEscape: String 10 | "\u123k" 11 | invalidUnicodeEscape2: String 12 | "\'" 13 | invalidEscapeChar: String 14 | } 15 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0014_plus_sign.graphql: -------------------------------------------------------------------------------- 1 | +1, + -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0014_plus_sign.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:1 "Unexpected character \"+\"" + 2 | INT@1:2 "1" 3 | COMMA@2:3 "," 4 | WHITESPACE@3:4 " " 5 | ERROR@4:5 "Unexpected character \"+\"" + 6 | EOF@5:5 7 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0015_minus_sign.graphql: -------------------------------------------------------------------------------- 1 | -1, - -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0015_minus_sign.txt: -------------------------------------------------------------------------------- 1 | INT@0:2 "-1" 2 | COMMA@2:3 "," 3 | WHITESPACE@3:4 " " 4 | ERROR@4:5 "Unexpected character \"-\"" - 5 | EOF@5:5 6 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0016_leading_zero.graphql: -------------------------------------------------------------------------------- 1 | # No error: 2 | 0 1 42 1.1 0.2 1e04 1e+04 1e-04 3 | -0 -1 -42 -1.1 -0.2 -1e04 -1e+04 -1e-04 4 | # Errors: 5 | 00 01 042 01.1 00.2 01e04 01e+04 01e-04 6 | -00 -01 -042 -01.1 -00.2 -01e04 -01e+04 -01e-04 7 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0017_number_lookahead.graphql: -------------------------------------------------------------------------------- 1 | # Both IntValue and FloatValue are specified with [lookahead != {Digit, `.`, NameStart}] 2 | 00 3 | 2. 4 | 2.2. 5 | 2.2.2 6 | 2e2. 7 | 2e2.2 8 | 2.2e2. 9 | 2.2e2.2 10 | 2_ 11 | 2.2_ 12 | 2e2_ 13 | 2.2e2_ 14 | 2x 15 | 2.2x 16 | 2e2x 17 | 2.2e2x 18 | 2e2e 19 | 2e2e2 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0018_eof_float_1.graphql: -------------------------------------------------------------------------------- 1 | 2. -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0018_eof_float_1.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:2 "Unexpected EOF in float value" 2. 2 | EOF@2:2 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0019_eof_float_2.graphql: -------------------------------------------------------------------------------- 1 | 2e -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0019_eof_float_2.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:2 "Unexpected EOF in float value" 2e 2 | EOF@2:2 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0020_eof_float_3.graphql: -------------------------------------------------------------------------------- 1 | 2e- -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0020_eof_float_3.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:3 "Unexpected EOF in float value" 2e- 2 | EOF@3:3 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0021_eof_float_4.graphql: -------------------------------------------------------------------------------- 1 | 2e+ -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0021_eof_float_4.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:3 "Unexpected EOF in float value" 2e+ 2 | EOF@3:3 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0022_eof_string_1.graphql: -------------------------------------------------------------------------------- 1 | " -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0022_eof_string_1.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:1 "unexpected end of data while lexing string value" " 2 | EOF@1:1 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0023_eof_string_1.graphql: -------------------------------------------------------------------------------- 1 | "\ -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0023_eof_string_1.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:2 "unterminated string value" "\ 2 | EOF@2:2 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0024_eof_string_2.graphql: -------------------------------------------------------------------------------- 1 | "\u -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0024_eof_string_2.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:3 "unterminated string value" "\u 2 | EOF@3:3 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0025_eof_string_3.graphql: -------------------------------------------------------------------------------- 1 | "\u222 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0025_eof_string_3.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:6 "unterminated string value" "\u222 2 | EOF@6:6 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0026_eof_block_string_1.graphql: -------------------------------------------------------------------------------- 1 | """ -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0026_eof_block_string_1.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:3 "unterminated string value" """ 2 | EOF@3:3 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0027_eof_block_string_2.graphql: -------------------------------------------------------------------------------- 1 | """\ -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0027_eof_block_string_2.txt: -------------------------------------------------------------------------------- 1 | ERROR@0:4 "unterminated string value" """\ 2 | EOF@4:4 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0029_not_whitespace.graphql: -------------------------------------------------------------------------------- 1 | # U+FEFF 2 | # U+000B 3 | # U+000C 4 | …# U+0085 5 |  # U+00A0 6 | ‎# U+200E 7 | ‏# U+200F 8 | 
# U+2028 9 | 
# U+2029 10 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/err/0029_not_whitespace.py: -------------------------------------------------------------------------------- 1 | assert __file__.endswith('.py') 2 | with open(__file__[:-3] + '.graphql', 'wb') as f: 3 | for c in '\uFEFF\u000B\u000C\u0085\u00A0\u200E\u200F\u2028\u2029': 4 | f.write(f'{c}# U+{ord(c):04X}\n'.encode('utf8')) -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0001_hello.graphql: -------------------------------------------------------------------------------- 1 | hello world -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0001_hello.txt: -------------------------------------------------------------------------------- 1 | NAME@0:5 "hello" 2 | WHITESPACE@5:6 " " 3 | NAME@6:11 "world" 4 | EOF@11:11 5 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0002_whitespace.graphql: -------------------------------------------------------------------------------- 1 | a b c 2 | d 3 | e f 4 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0002_whitespace.txt: -------------------------------------------------------------------------------- 1 | NAME@0:1 "a" 2 | WHITESPACE@1:2 " " 3 | NAME@2:3 "b" 4 | WHITESPACE@3:5 " " 5 | NAME@5:6 "c" 6 | WHITESPACE@6:7 "\n" 7 | NAME@7:8 "d" 8 | WHITESPACE@8:11 "\r\n\r" 9 | NAME@11:12 "e" 10 | WHITESPACE@12:13 "\t" 11 | NAME@13:14 "f" 12 | WHITESPACE@14:15 "\n" 13 | EOF@15:15 14 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0003_name.graphql: -------------------------------------------------------------------------------- 1 | name_ _name __ n0me nam n -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0003_name.txt: -------------------------------------------------------------------------------- 1 | NAME@0:5 "name_" 2 | WHITESPACE@5:6 " " 3 | NAME@6:11 "_name" 4 | WHITESPACE@11:12 " " 5 | NAME@12:14 "__" 6 | WHITESPACE@14:15 " " 7 | NAME@15:19 "n0me" 8 | WHITESPACE@19:20 " " 9 | NAME@20:23 "nam" 10 | WHITESPACE@23:24 " " 11 | NAME@24:25 "n" 12 | EOF@25:25 13 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0004_string_value.graphql: -------------------------------------------------------------------------------- 1 | "" 2 | "simple" 3 | " white space " 4 | "unicode \u1234\u5678\u90AB\uCDEF" 5 | "string with \"escaped\" characters" 6 | "string with multiple languages котя, 猫, ねこ, قطة" 7 | """ 8 | block string with unusual whitespaces 9 | a b c 10 | d 11 | 12 | e f 13 | g

h 14 | i j kl…‎‏m 15 | """ 16 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0005_int.graphql: -------------------------------------------------------------------------------- 1 | -4 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0005_int.txt: -------------------------------------------------------------------------------- 1 | INT@0:2 "-4" 2 | EOF@2:2 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0006_float.graphql: -------------------------------------------------------------------------------- 1 | 4.123 2 | -4.123 3 | 0.123 4 | 123e4 5 | 123E4 6 | 123e-4 7 | 123e+4 8 | -1.123e4 9 | -1.123E4 10 | -1.123e-4 11 | -1.123e+4 12 | -1.123e4567 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0007_symbols.graphql: -------------------------------------------------------------------------------- 1 | ! $ & ... , : = @ ( ) [ ] { } | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0008_block_string.graphql: -------------------------------------------------------------------------------- 1 | """ 2 | Input Filter with title fitlering 3 | """ 4 | input Filter { 5 | """unicode in block string 🤷""" 6 | title: String 7 | } 8 | 9 | """ 10 | \""" a/b \""" 11 | """ 12 | input Filter { 13 | title: String 14 | } 15 | 16 | """ 17 | \\""" 18 | """ 19 | scalar LiteralBackslashThenEscape 20 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0009_block_string_character_with_loose_quotations.graphql: -------------------------------------------------------------------------------- 1 | """ 2 | Example with " 3 | """ 4 | type Store { 5 | """ 6 | **Example**: "Saturn5" 7 | """ 8 | name: String @join__field(graph: PRODUCTS) 9 | """ 10 | "Another Example 11 | """ 12 | title: String 13 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0010_empty_string_value_followed_by_eof.graphql: -------------------------------------------------------------------------------- 1 | "" -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0010_empty_string_value_followed_by_eof.txt: -------------------------------------------------------------------------------- 1 | STRING_VALUE@0:2 "\"\"" 2 | EOF@2:2 3 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0011_escaped_char.graphql: -------------------------------------------------------------------------------- 1 | { name: "\"my store\"" } 2 | 3 | type Query { 4 | name: String 5 | format: String = "Y-m-d\\TH:i:sP" 6 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0012_unicode_char.graphql: -------------------------------------------------------------------------------- 1 | { name: "\u006Dy store\"" } 2 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0012_unicode_char.txt: -------------------------------------------------------------------------------- 1 | L_CURLY@0:1 "{" 2 | WHITESPACE@1:2 " " 3 | NAME@2:6 "name" 4 | COLON@6:7 ":" 5 | WHITESPACE@7:8 " " 6 | STRING_VALUE@8:25 "\"\\u006Dy store\\\"\"" 7 | WHITESPACE@25:26 " " 8 | R_CURLY@26:27 "}" 9 | WHITESPACE@27:28 "\n" 10 | EOF@28:28 11 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/lexer/ok/0013_emoji_char_in_string_value.graphql: -------------------------------------------------------------------------------- 1 | mutation UpdateStuff { 2 | stuffUpdate(input: { 3 | tags: "really great 👻 halloween" 4 | }) { stuff { tags } } 5 | } 6 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0001_directive_definition_missing_location.graphql: -------------------------------------------------------------------------------- 1 | directive @example on -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0001_directive_definition_missing_location.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..21 2 | - DIRECTIVE_DEFINITION@0..21 3 | - directive_KW@0..9 "directive" 4 | - WHITESPACE@9..10 " " 5 | - AT@10..11 "@" 6 | - NAME@11..18 7 | - IDENT@11..18 "example" 8 | - WHITESPACE@18..19 " " 9 | - on_KW@19..21 "on" 10 | - ERROR@21:21 "expected valid Directive Location" EOF 11 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0002_enum_definition_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | enum { 2 | NORTH 3 | EAST 4 | SOUTH 5 | WEST 6 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0003_enum_definition_with_missing_values.graphql: -------------------------------------------------------------------------------- 1 | enum Direction { 2 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0003_enum_definition_with_missing_values.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..18 2 | - ENUM_TYPE_DEFINITION@0..18 3 | - enum_KW@0..4 "enum" 4 | - WHITESPACE@4..5 " " 5 | - NAME@5..14 6 | - IDENT@5..14 "Direction" 7 | - WHITESPACE@14..15 " " 8 | - ENUM_VALUES_DEFINITION@15..18 9 | - L_CURLY@15..16 "{" 10 | - WHITESPACE@16..17 "\n" 11 | - R_CURLY@17..18 "}" 12 | - ERROR@17:18 "expected Enum Value Definition" } 13 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0004_enum_definition_with_missing_curly.graphql: -------------------------------------------------------------------------------- 1 | enum Direction { NORTH WEST -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0005_enum_extension_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | extend enum { 2 | NORTH 3 | EAST 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0006_enum_extension_with_missing_requirements.graphql: -------------------------------------------------------------------------------- 1 | extend enum Direction -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0006_enum_extension_with_missing_requirements.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..21 2 | - ENUM_TYPE_EXTENSION@0..21 3 | - extend_KW@0..6 "extend" 4 | - WHITESPACE@6..7 " " 5 | - enum_KW@7..11 "enum" 6 | - WHITESPACE@11..12 " " 7 | - NAME@12..21 8 | - IDENT@12..21 "Direction" 9 | - ERROR@21:21 "expected Directive or Enum Values Definition" EOF 10 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0007_fragment_definition_with_invalid_fragment_name.graphql: -------------------------------------------------------------------------------- 1 | fragment on User @example { 2 | id 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0008_fragment_definition_with_invalid_type_condition.graphql: -------------------------------------------------------------------------------- 1 | fragment friendFields User @example { 2 | id 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0009_fragment_definition_with_invalid_selection_set.graphql: -------------------------------------------------------------------------------- 1 | fragment friendFields on User -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0010_input_definition_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | input { 2 | a: String 3 | b: Int! 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0011_input_definition_with_missing_input_values.graphql: -------------------------------------------------------------------------------- 1 | input ExampleInputObject {} -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0011_input_definition_with_missing_input_values.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..27 2 | - INPUT_OBJECT_TYPE_DEFINITION@0..27 3 | - input_KW@0..5 "input" 4 | - WHITESPACE@5..6 " " 5 | - NAME@6..24 6 | - IDENT@6..24 "ExampleInputObject" 7 | - WHITESPACE@24..25 " " 8 | - INPUT_FIELDS_DEFINITION@25..27 9 | - L_CURLY@25..26 "{" 10 | - R_CURLY@26..27 "}" 11 | - ERROR@26:27 "expected an Input Value Definition" } 12 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0012_input_extension_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | extend input { 2 | a: String 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0013_input_extension_with_missing_requirements.graphql: -------------------------------------------------------------------------------- 1 | extend input ExampleInputObject -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0013_input_extension_with_missing_requirements.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..31 2 | - INPUT_OBJECT_TYPE_EXTENSION@0..31 3 | - extend_KW@0..6 "extend" 4 | - WHITESPACE@6..7 " " 5 | - input_KW@7..12 "input" 6 | - WHITESPACE@12..13 " " 7 | - NAME@13..31 8 | - IDENT@13..31 "ExampleInputObject" 9 | - ERROR@31:31 "expected Directives or an Input Fields Definition" EOF 10 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0014_interface_extension_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | extend interface { 2 | value: Int 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0015_interface_extension_with_missing_requirements.graphql: -------------------------------------------------------------------------------- 1 | extend interface ValuedEntity -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0015_interface_extension_with_missing_requirements.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..29 2 | - INTERFACE_TYPE_EXTENSION@0..29 3 | - extend_KW@0..6 "extend" 4 | - WHITESPACE@6..7 " " 5 | - interface_KW@7..16 "interface" 6 | - WHITESPACE@16..17 " " 7 | - NAME@17..29 8 | - IDENT@17..29 "ValuedEntity" 9 | - ERROR@29:29 "exptected an Implements Interfaces, Directives, or a Fields Definition" EOF 10 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0016_object_type_extension_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | extend type { 2 | name: String 3 | age: Int 4 | picture: Url 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0017_object_type_extension_with_missing_requirements.graphql: -------------------------------------------------------------------------------- 1 | extend type Person -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0017_object_type_extension_with_missing_requirements.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..18 2 | - OBJECT_TYPE_EXTENSION@0..18 3 | - extend_KW@0..6 "extend" 4 | - WHITESPACE@6..7 " " 5 | - type_KW@7..11 "type" 6 | - WHITESPACE@11..12 " " 7 | - NAME@12..18 8 | - IDENT@12..18 "Person" 9 | - ERROR@18:18 "expected an Implements Interface, Directives or a Fields Definition" EOF 10 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0018_scalar_definition_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | scalar @deprecated -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0018_scalar_definition_with_missing_name.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..18 2 | - SCALAR_TYPE_DEFINITION@0..18 3 | - scalar_KW@0..6 "scalar" 4 | - WHITESPACE@6..7 " " 5 | - DIRECTIVES@7..18 6 | - DIRECTIVE@7..18 7 | - AT@7..8 "@" 8 | - NAME@8..18 9 | - IDENT@8..18 "deprecated" 10 | - ERROR@7:8 "expected a Name" @ 11 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0019_scalar_extension_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | extend scalar @deprecated -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0019_scalar_extension_with_missing_name.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..25 2 | - SCALAR_TYPE_EXTENSION@0..25 3 | - extend_KW@0..6 "extend" 4 | - WHITESPACE@6..7 " " 5 | - scalar_KW@7..13 "scalar" 6 | - WHITESPACE@13..14 " " 7 | - DIRECTIVES@14..25 8 | - DIRECTIVE@14..25 9 | - AT@14..15 "@" 10 | - NAME@15..25 11 | - IDENT@15..25 "deprecated" 12 | - ERROR@14:15 "expected a Name" @ 13 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0020_union_definition_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | union = Photo | Person -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0021_union_definition_with_missing_union_members.graphql: -------------------------------------------------------------------------------- 1 | union = -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0021_union_definition_with_missing_union_members.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..7 2 | - UNION_TYPE_DEFINITION@0..7 3 | - union_KW@0..5 "union" 4 | - WHITESPACE@5..6 " " 5 | - UNION_MEMBER_TYPES@6..7 6 | - EQ@6..7 "=" 7 | - ERROR@6:7 "expected a Name" = 8 | - ERROR@7:7 "expected Union Member Type" EOF 9 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0022_union_extension_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | extend union = Photo | Person -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0023_union_extension_with_missing_requirements.graphql: -------------------------------------------------------------------------------- 1 | extend union SearchResult -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0023_union_extension_with_missing_requirements.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..25 2 | - UNION_TYPE_EXTENSION@0..25 3 | - extend_KW@0..6 "extend" 4 | - WHITESPACE@6..7 " " 5 | - union_KW@7..12 "union" 6 | - WHITESPACE@12..13 " " 7 | - NAME@13..25 8 | - IDENT@13..25 "SearchResult" 9 | - ERROR@25:25 "expected Directives or Union Member Types" EOF 10 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0024_document_with_incorrect_definition.graphql: -------------------------------------------------------------------------------- 1 | awsas8d2934213hkj0987 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0024_document_with_incorrect_definition.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..21 2 | - ERROR@0..21 "awsas8d2934213hkj0987" 3 | - ERROR@0:21 "expected definition" awsas8d2934213hkj0987 4 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0025_document_with_incorrect_definition_and_selection_set.graphql: -------------------------------------------------------------------------------- 1 | uasdf21230jkdw 2 | 3 | { 4 | pet 5 | faveSnack 6 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0026_invalid_definition_squished_between_two_valid_definitions.graphql: -------------------------------------------------------------------------------- 1 | enum Direction @example { 2 | """ 3 | description 4 | """ 5 | NORTH 6 | EAST 7 | SOUTH 8 | WEST 9 | } 10 | 11 | uasdf21230jkdw 12 | 13 | { 14 | pet 15 | faveSnack 16 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0027_invalid_type_system_extension.graphql: -------------------------------------------------------------------------------- 1 | extend Cat -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0027_invalid_type_system_extension.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..10 2 | - ERROR@0..6 "extend" 3 | - WHITESPACE@6..7 " " 4 | - ERROR@7..10 "Cat" 5 | - ERROR@0:6 "Invalid Type System Extension. This extension cannot be applied." extend 6 | - ERROR@7:10 "expected definition" Cat 7 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0028_invalid_type_system_extension_followed_by_valid.graphql: -------------------------------------------------------------------------------- 1 | extend Cat 2 | 3 | extend interface NamedEntity { 4 | name: String 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0029_operation_definition_with_empty_selection_set.graphql: -------------------------------------------------------------------------------- 1 | query {} -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0029_operation_definition_with_empty_selection_set.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..8 2 | - OPERATION_DEFINITION@0..8 3 | - OPERATION_TYPE@0..5 4 | - query_KW@0..5 "query" 5 | - WHITESPACE@5..6 " " 6 | - SELECTION_SET@6..8 7 | - L_CURLY@6..7 "{" 8 | - R_CURLY@7..8 "}" 9 | - ERROR@7:8 "expected at least one Selection in Selection Set" } 10 | recursion limit: 500, high: 1 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0030_operation_definition_with_description.graphql: -------------------------------------------------------------------------------- 1 | "after this PR this should not be an issue: https://github.com/graphql/graphql-spec/pull/892" 2 | query empty {} -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0031_argument_with_erronous_string_value.graphql: -------------------------------------------------------------------------------- 1 | { 2 | user(id: "\string ID") 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0032_input_value_with_erronous_string_value.graphql: -------------------------------------------------------------------------------- 1 | type Person { 2 | name: String 3 | picture(reference: "\a reference image"): Url 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0033_directive_with_erronous_string_value.graphql: -------------------------------------------------------------------------------- 1 | directive @delegateField(name: String!) repeatable on OBJECT | INTERFACE 2 | 3 | type Book @delegateField(name: "\ errronous string \""){ 4 | id: ID! 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0034_unterminated_string_value_in_list.graphql: -------------------------------------------------------------------------------- 1 | extend schema 2 | @link(url: "https://specs.apollo.dev/federation/v2.0", 3 | import: ["@key", "@external]) 4 | 5 | 6 | type Vehicle @key(fields: "id") { 7 | id: ID!, 8 | type: String, 9 | modelCode: String, 10 | brandName: String, 11 | launchDate: String 12 | } 13 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0035_unterminated_string_value_in_object_value.graphql: -------------------------------------------------------------------------------- 1 | mutation { 2 | createStore(draft: { 3 | name: [{ locale: "en", value: "my store }] 4 | }) { 5 | name(locale: "en") 6 | } 7 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0036_unterminated_string_in_default_value.graphql: -------------------------------------------------------------------------------- 1 | type Person { 2 | name: String 3 | picture(url: String = "https://spec.graphql.org/October2021/#DefaultValue): Url 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0040_operation_definition_missing_selection_set.graphql: -------------------------------------------------------------------------------- 1 | query __typename } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0040_operation_definition_missing_selection_set.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..18 2 | - OPERATION_DEFINITION@0..18 3 | - OPERATION_TYPE@0..5 4 | - query_KW@0..5 "query" 5 | - WHITESPACE@5..6 " " 6 | - NAME@6..16 7 | - IDENT@6..16 "__typename" 8 | - WHITESPACE@16..17 " " 9 | - ERROR@17..18 "}" 10 | - ERROR@17:18 "expected a Selection Set" } 11 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0041_operation_definition_with_missing_selection_set.graphql: -------------------------------------------------------------------------------- 1 | query __typename -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0041_operation_definition_with_missing_selection_set.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..16 2 | - OPERATION_DEFINITION@0..16 3 | - OPERATION_TYPE@0..5 4 | - query_KW@0..5 "query" 5 | - WHITESPACE@5..6 " " 6 | - NAME@6..16 7 | - IDENT@6..16 "__typename" 8 | - ERROR@16..16 "" 9 | - ERROR@16:16 "expected a Selection Set" EOF 10 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0042_document_with_incorrect_token.graphql: -------------------------------------------------------------------------------- 1 | @ 2 | # comment 3 | { 4 | pet 5 | faveSnack 6 | } 7 | 8 | # comment 9 | } 10 | 11 | type Query { 12 | name: String 13 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0043_type_with_trailing_garbage.graphql: -------------------------------------------------------------------------------- 1 | type Person { 2 | id: ID! 3 | appearedIn: [Film]s 4 | name: String 5 | directed: [Film] 6 | } 7 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0044_list_type_with_no_type.graphql: -------------------------------------------------------------------------------- 1 | type List { 2 | field: [] @coolDirective 3 | deepError: [[[Item Type]]] 4 | } 5 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0045_ignored_token_spans.graphql: -------------------------------------------------------------------------------- 1 | cats 2 | # https://github.com/apollographql/apollo-rs/issues/325 3 | 4 | interface X 5 | 6 | cats 7 | type Query { 8 | name: String 9 | } 10 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0046_incomplete_spreads.graphql: -------------------------------------------------------------------------------- 1 | { inner { ... }} 2 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0047_empty_variable_definition.graphql: -------------------------------------------------------------------------------- 1 | query Op() { 2 | field 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0048_unbalanced_list_type_1.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | unbalanced: [[Int]]] 3 | } 4 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0049_unbalanced_list_type_2.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | unbalanced: [[[Int]] 3 | } 4 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0050_invalid_implements_list.graphql: -------------------------------------------------------------------------------- 1 | type Obj implements A & { field: Int } 2 | 3 | type Obj implements A B { field: Int } 4 | 5 | type Obj implements A && B { field: Int } 6 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0051_union_with_invalid_members_list.graphql: -------------------------------------------------------------------------------- 1 | "Missing separator" 2 | union SearchResult = Photo Person 3 | 4 | "Double separator" 5 | union SearchResult2 = Photo || Person 6 | 7 | "Dangling separator" 8 | union SearchResult3 = | Photo | Person | 9 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0052_const_value.graphql: -------------------------------------------------------------------------------- 1 | query( 2 | $var1: Boolean! 3 | $var2: Boolean! = $var 4 | ) { 5 | f1 @include(if: $var1) 6 | f2 @include(if: $var2) 7 | } 8 | 9 | directive @someDir(arg: Boolean) on OBJECT 10 | 11 | type Query @someDir(arg: $var1) { 12 | f1: Int 13 | f2: Int 14 | } 15 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0053_on_without_type_condition.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | ... on { 3 | field 4 | } 5 | } 6 | 7 | fragment F on { 8 | field 9 | } 10 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0054_root_operation_type_with_extra_brackets.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: Query 3 | { mutation: Mutation 4 | { subscription: Subscription 5 | } 6 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0055_object_definition_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | type { 2 | id: String 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0056_object_definition_with_missing_curly.graphql: -------------------------------------------------------------------------------- 1 | type Person { id: String -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0057_object_definition_with_missing_fields.graphql: -------------------------------------------------------------------------------- 1 | type Person { 2 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0057_object_definition_with_missing_fields.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..15 2 | - OBJECT_TYPE_DEFINITION@0..15 3 | - type_KW@0..4 "type" 4 | - WHITESPACE@4..5 " " 5 | - NAME@5..11 6 | - IDENT@5..11 "Person" 7 | - WHITESPACE@11..12 " " 8 | - FIELDS_DEFINITION@12..15 9 | - L_CURLY@12..13 "{" 10 | - WHITESPACE@13..14 "\n" 11 | - R_CURLY@14..15 "}" 12 | - ERROR@14:15 "expected Field Definition" } 13 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0058_interface_definition_with_missing_name.graphql: -------------------------------------------------------------------------------- 1 | interface { 2 | id: String 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0059_interface_definition_with_missing_fields.graphql: -------------------------------------------------------------------------------- 1 | interface Person { 2 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0059_interface_definition_with_missing_fields.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..20 2 | - INTERFACE_TYPE_DEFINITION@0..20 3 | - interface_KW@0..9 "interface" 4 | - WHITESPACE@9..10 " " 5 | - NAME@10..16 6 | - IDENT@10..16 "Person" 7 | - WHITESPACE@16..17 " " 8 | - FIELDS_DEFINITION@17..20 9 | - L_CURLY@17..18 "{" 10 | - WHITESPACE@18..19 "\n" 11 | - R_CURLY@19..20 "}" 12 | - ERROR@19:20 "expected Field Definition" } 13 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0060_interface_definition_with_missing_curly.graphql: -------------------------------------------------------------------------------- 1 | interface Person { id: String -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0061_empty.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apollographql/apollo-rs/70aba3ffcafdeb892b9791c1bfed86ff928dc2f6/crates/apollo-parser/test_data/parser/err/0061_empty.graphql -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/err/0061_empty.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..0 2 | - ERROR@1:1 "Unexpected ." EOF 3 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0001_input_type_definition_without_input_values.graphql: -------------------------------------------------------------------------------- 1 | "An input with no input values" 2 | input AnInputWithoutInputValues 3 | 4 | extend input AnInputWithoutInputValues { 5 | limit: Int! 6 | } 7 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0002_selection_simple.graphql: -------------------------------------------------------------------------------- 1 | { 2 | pet 3 | faveSnack 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0003_selection_with_fields.graphql: -------------------------------------------------------------------------------- 1 | 2 | { 3 | pet { 4 | name 5 | birthday { 6 | month 7 | day 8 | } 9 | playmates { 10 | name 11 | faveSnack 12 | } 13 | } 14 | faveSnack 15 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0004_selection_with_fields_aliases_arguments.graphql: -------------------------------------------------------------------------------- 1 | 2 | { 3 | pet { 4 | name: nickname 5 | birthday { 6 | month 7 | day 8 | } 9 | playmates { 10 | name 11 | faveSnack 12 | } 13 | } 14 | faveSnack(quantity: 4) 15 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0005_selection_with_inline_fragments.graphql: -------------------------------------------------------------------------------- 1 | { 2 | animal 3 | faveSnack 4 | ... on Pet { 5 | playmates { 6 | count 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0006_selection_with_fragment_spread.graphql: -------------------------------------------------------------------------------- 1 | { 2 | pet 3 | ...snackSelection 4 | ... on Nap { 5 | cozyLocation 6 | durationOfNap 7 | } 8 | ...snackSelection @deprecated 9 | ... on Nap @provides(duration: "2 hours") { 10 | cozyLocation 11 | } 12 | ... @J(N: 0) { 13 | a 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0007_directive_definition.graphql: -------------------------------------------------------------------------------- 1 | directive @example on FIELD -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0008_directive_definition_with_arguments.graphql: -------------------------------------------------------------------------------- 1 | directive @example(isTreat: Boolean, treatKind: String) on FIELD | MUTATION -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0009_directive_definition_repeatable.graphql: -------------------------------------------------------------------------------- 1 | directive @example(isTreat: Boolean, treatKind: String) repeatable on FIELD | MUTATION -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0010_enum_type_definition.graphql: -------------------------------------------------------------------------------- 1 | enum Direction @example { 2 | """ 3 | description 4 | """ 5 | NORTH 6 | EAST 7 | SOUTH 8 | WEST 9 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0011_enum_type_extension.graphql: -------------------------------------------------------------------------------- 1 | extend enum Direction @example { 2 | SOUTH 3 | WEST 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0012_fragment_definition.graphql: -------------------------------------------------------------------------------- 1 | fragment friendFields on User @example { 2 | id 3 | name 4 | profilePic(size: 50) 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0013_fragment_definition_with_fragment_spread.graphql: -------------------------------------------------------------------------------- 1 | fragment friendFields on User { 2 | id 3 | name 4 | ...standardProfilePic 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0014_input_definition.graphql: -------------------------------------------------------------------------------- 1 | input ExampleInputObject { 2 | a: String 3 | b: Int! 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0015_input_extension.graphql: -------------------------------------------------------------------------------- 1 | extend input ExampleInputObject @skip { 2 | a: String 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0016_interface_definition.graphql: -------------------------------------------------------------------------------- 1 | interface ValuedEntity { 2 | value: Int 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0017_interface_extension.graphql: -------------------------------------------------------------------------------- 1 | extend interface ValuedEntity @skip { 2 | value: Int 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0018_object_type_definition.graphql: -------------------------------------------------------------------------------- 1 | "description of type" 2 | type Person implements Human { 3 | """ 4 | description of field 5 | """ 6 | name: String 7 | age: Int 8 | picture: Url 9 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0019_object_type_extension.graphql: -------------------------------------------------------------------------------- 1 | extend type Person implements Human @deprecated { 2 | name: String 3 | age: Int 4 | picture: Url 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0020_operation_type_definition.graphql: -------------------------------------------------------------------------------- 1 | query myQuery { 2 | animal: cat 3 | dog { 4 | panda { 5 | anotherCat @deprecated 6 | } 7 | } 8 | lion 9 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0021_operation_type_definition_with_arguments.graphql: -------------------------------------------------------------------------------- 1 | query myQuery($var: input $varOther: otherInput){ 2 | animal 3 | treat 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0022_operation_type_definition_with_arguments_and_directives.graphql: -------------------------------------------------------------------------------- 1 | query myQuery($var: input $varOther: otherInput) @deprecated @unused { 2 | animal 3 | treat 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0023_scalar_definition.graphql: -------------------------------------------------------------------------------- 1 | scalar Time @deprecated -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0023_scalar_definition.txt: -------------------------------------------------------------------------------- 1 | - DOCUMENT@0..23 2 | - SCALAR_TYPE_DEFINITION@0..23 3 | - scalar_KW@0..6 "scalar" 4 | - WHITESPACE@6..7 " " 5 | - NAME@7..11 6 | - IDENT@7..11 "Time" 7 | - WHITESPACE@11..12 " " 8 | - DIRECTIVES@12..23 9 | - DIRECTIVE@12..23 10 | - AT@12..13 "@" 11 | - NAME@13..23 12 | - IDENT@13..23 "deprecated" 13 | recursion limit: 500, high: 0 -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0024_scalar_extension.graphql: -------------------------------------------------------------------------------- 1 | extend scalar Time @deprecated -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0025_schema_definition.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: MyQueryRootType 3 | mutation: MyMutationRootType, 4 | subscription: MySubscriptionRootType 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0026_schema_extension.graphql: -------------------------------------------------------------------------------- 1 | extend schema @skip @example { 2 | query: MyExtendedQueryType 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0027_union_type_definition.graphql: -------------------------------------------------------------------------------- 1 | union SearchResult = Photo | Person 2 | 3 | union MultiLine = 4 | | Photo 5 | | Person 6 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0028_union_type_definition_followed_by_object_definition.graphql: -------------------------------------------------------------------------------- 1 | union SearchResult = Photo | Person 2 | 3 | type Error { 4 | code: Int 5 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0029_union_type_extension.graphql: -------------------------------------------------------------------------------- 1 | extend union SearchResult @deprecated = Photo | Person -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0030_values.graphql: -------------------------------------------------------------------------------- 1 | { 2 | user( 3 | id: 4, 4 | size: $size 5 | value: "string", 6 | input: [ "one", 1.34 ], 7 | otherInput: { key: false, output: null } 8 | emptyList: [] 9 | emptyObject: {} 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0031_variables_with_default.graphql: -------------------------------------------------------------------------------- 1 | query getOutput($input: Int = 5 $config: String = "Config") { 2 | animal 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0033_directive_on_argument_definition.graphql: -------------------------------------------------------------------------------- 1 | type Mutation { 2 | login(userId: String @deprecated(reason: "Use username instead")): User 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0034_query_shorthand_followed_by_fragment_definition.graphql: -------------------------------------------------------------------------------- 1 | { 2 | ...friendFields 3 | } 4 | 5 | fragment friendFields on User { 6 | id 7 | name 8 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0035_query_with_variables.graphql: -------------------------------------------------------------------------------- 1 | query Foo($bar: Int) { 2 | name 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0036_parses_variable_definition_with_list_type.graphql: -------------------------------------------------------------------------------- 1 | query ($height: [Int]) { 2 | id 3 | trees(height: $height) 4 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0037_operation_type_definition_with_inline_fragment.graphql: -------------------------------------------------------------------------------- 1 | query SomeQuery( 2 | $param1: String! 3 | $param2: String! 4 | ) { 5 | item1( 6 | param1: $param1 7 | param2: $param2 8 | ) { 9 | id 10 | ... on Fragment1 { 11 | field3 { 12 | field4 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0038_wrapped_named_types.graphql: -------------------------------------------------------------------------------- 1 | type ObjectDef { 2 | a: String 3 | b: Int! 4 | c: [Int!]! 5 | d: [[[[[Int]]]]] 6 | d: [[[[[Int!]!]!]!]!]! 7 | } 8 | 9 | type ObjectDefTwo { 10 | a: String, 11 | b: Int!, 12 | c: [Int!]!, 13 | d: [[[[[Int]]]]], 14 | d: [[[[[Int!]!]!]!]!]!, 15 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0039_variable_with_directives.graphql: -------------------------------------------------------------------------------- 1 | query getOutput($input: Int @deprecated $config: String = "Config" @tag(name: "team-customers")) { 2 | animal 3 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0040_type_token_order.graphql: -------------------------------------------------------------------------------- 1 | type Object { 2 | #(apparently you can stick a comma in there?? please dont do it!) 3 | field : [Int ,!] # comment 4 | _other: 5 | String,,, , 6 | #garbage 7 | realField: ID! 8 | } 9 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0041_implements_list.graphql: -------------------------------------------------------------------------------- 1 | "Just one interface" 2 | type One implements A { field: Int! } 3 | 4 | "Several interfaces" 5 | type Two implements A & B & C { field: Int! } 6 | 7 | "&-prefixed" 8 | type Three implements 9 | & A 10 | & B 11 | & C 12 | { field: Int! } 13 | -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0042_object_type_definition_without_fields.graphql: -------------------------------------------------------------------------------- 1 | "A type with no fields" 2 | type AnObjectTypeWithoutFields 3 | 4 | extend type AnObjectTypeWithoutFields { 5 | id: ID! 6 | } -------------------------------------------------------------------------------- /crates/apollo-parser/test_data/parser/ok/0043_interface_type_definition_without_fields.graphql: -------------------------------------------------------------------------------- 1 | "An interface with no fields" 2 | interface AnInterfaceWithoutFields 3 | 4 | extend interface AnInterfaceWithoutFields { 5 | id: ID! 6 | } 7 | -------------------------------------------------------------------------------- /crates/apollo-smith/LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | ../../LICENSE-APACHE -------------------------------------------------------------------------------- /crates/apollo-smith/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | ../../LICENSE-MIT -------------------------------------------------------------------------------- /examples/validation-wasm-demo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "validation-wasm-demo" 3 | version = "0.1.0" 4 | edition = "2024" 5 | 6 | [lib] 7 | crate-type = ["cdylib"] 8 | 9 | [dependencies] 10 | apollo-compiler.path = "../../crates/apollo-compiler" 11 | # https://docs.rs/getrandom/0.3.3/getrandom/index.html#webassembly-support 12 | # Works together with the rustflags configuration in `.cargo/config.toml` 13 | getrandom = { version = "0.3", features = ["wasm_js"] } 14 | wasm-bindgen = "0.2.100" 15 | -------------------------------------------------------------------------------- /examples/validation-wasm-demo/README.md: -------------------------------------------------------------------------------- 1 | # WebAssembly demo of GraphQL validation 2 | 3 | 1. [Install wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) 4 | 2. Install either [miniserve](https://crates.io/crates/miniserve) with `cargo install miniserve`, 5 | or Python 6 | 3. Move to this directory if needed: `cd examples/validation-wasm-demo` 7 | 3. Build with `wasm-pack build --target web` 8 | 4. Start an HTTP server with `miniserve --index index.html` or `python3 -m http.server` 9 | 5. Navigate to [http://127.0.0.1:8080/](http://127.0.0.1:8080/) -------------------------------------------------------------------------------- /fuzz/.gitignore: -------------------------------------------------------------------------------- 1 | /artifacts 2 | /corpus 3 | -------------------------------------------------------------------------------- /fuzz/fuzz_targets/coordinate.rs: -------------------------------------------------------------------------------- 1 | #![no_main] 2 | use apollo_compiler::coordinate::SchemaCoordinate; 3 | use libfuzzer_sys::fuzz_target; 4 | use log::debug; 5 | 6 | fuzz_target!(|data: &str| { 7 | let _ = env_logger::try_init(); 8 | 9 | let coord = data.parse::(); 10 | if let Ok(coord) = &coord { 11 | assert_eq!( 12 | &coord.to_string().parse::().unwrap(), 13 | coord 14 | ); 15 | } 16 | 17 | debug!("{:?}", coord); 18 | }); 19 | -------------------------------------------------------------------------------- /images/apollo_parser_tree_manipulation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apollographql/apollo-rs/70aba3ffcafdeb892b9791c1bfed86ff928dc2f6/images/apollo_parser_tree_manipulation.png -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | imports_granularity = "Item" 2 | group_imports = "One" 3 | -------------------------------------------------------------------------------- /xtask/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "xtask" 3 | version = "0.1.0" 4 | publish = false 5 | edition = "2021" 6 | 7 | [dependencies] 8 | ungrammar = "1.16.1" 9 | proc-macro2 = "1.0.8" 10 | quote = "1.0.2" 11 | xshell = "0.2" 12 | anyhow = "1" 13 | clap = { version = "4.4.0", features = ["derive"] } 14 | --------------------------------------------------------------------------------