From 72ed45a77c2772599ad180bc4150f7b8f69a799b Mon Sep 17 00:00:00 2001 From: Kai Ren Date: Fri, 8 Apr 2022 17:44:50 +0300 Subject: [PATCH] Rework CI and project toolchain (#1043) - remove `cargo-make` integration - rework CI pipeline more granular and precise - rework releasing process - tune up project layout - fill up new CHANGELOGs Additionally: - fix latest nightly/stable Rust inconsistencies --- .github/dependabot.yml | 41 +- .github/workflows/book.yml | 57 - .github/workflows/ci.yml | 423 ++++++-- .gitignore | 10 +- rustfmt.toml => .rustfmt.toml | 0 Cargo.toml | 38 +- Makefile | 139 +++ Makefile.toml | 38 - RELEASING.md | 87 +- _build/azure-pipelines-template.yml | 71 -- _build/cargo-make.ps1 | 21 - _build/cargo-make.sh | 19 - _build/release.toml | 6 - _build/travis-juniper.enc | 1 - azure-pipelines.yml | 109 -- {juniper_benchmarks => benches}/Cargo.toml | 5 +- .../benches/benchmark.rs | 0 {juniper_benchmarks => benches}/src/lib.rs | 0 book/.gitignore | 2 + book/README.md | 67 ++ book/book.toml | 16 + {docs/book/content => book/src}/README.md | 0 {docs/book/content => book/src}/SUMMARY.md | 0 .../src}/advanced/dataloaders.md | 10 +- .../advanced/implicit_and_explicit_null.md | 0 .../content => book/src}/advanced/index.md | 0 .../src}/advanced/introspection.md | 0 .../src}/advanced/multiple_ops_per_request.md | 0 .../src}/advanced/non_struct_objects.md | 0 .../src}/advanced/objects_and_generics.md | 0 .../src}/advanced/subscriptions.md | 4 +- {docs/book/content => book/src}/quickstart.md | 2 +- .../src}/schema/schemas_and_mutations.md | 1 + .../content => book/src}/servers/hyper.md | 4 +- .../content => book/src}/servers/index.md | 0 .../book/content => book/src}/servers/iron.md | 4 +- .../content => book/src}/servers/official.md | 0 .../content => book/src}/servers/rocket.md | 4 +- .../src}/servers/third-party.md | 0 .../book/content => book/src}/servers/warp.md | 4 +- .../content => book/src}/styles/website.css | 0 .../book/content => book/src}/types/enums.md | 0 .../book/content => book/src}/types/index.md | 0 .../src}/types/input_objects.md | 0 .../content => book/src}/types/interfaces.md | 0 .../src}/types/objects/complex_fields.md | 0 .../src}/types/objects/defining_objects.md | 0 .../src}/types/objects/error_handling.md | 0 .../src}/types/objects/using_contexts.md | 0 .../content => book/src}/types/other-index.md | 0 .../content => book/src}/types/scalars.md | 0 .../book/content => book/src}/types/unions.md | 0 book/tests/Cargo.toml | 22 + book/tests/build.rs | 4 + {docs/book => book}/tests/src/lib.rs | 0 docs/book/.gitignore | 1 - docs/book/README.md | 48 - docs/book/book.toml | 11 - docs/book/ci-build.sh | 52 - docs/book/tests/.gitignore | 3 - docs/book/tests/Cargo.toml | 26 - docs/book/tests/build.rs | 4 - examples/actix_subscriptions/Cargo.toml | 18 +- examples/actix_subscriptions/Makefile.toml | 15 - examples/basic_subscriptions/.gitignore | 1 - examples/basic_subscriptions/Cargo.toml | 13 +- examples/basic_subscriptions/Makefile.toml | 15 - examples/warp_async/.gitignore | 1 - examples/warp_async/Cargo.toml | 15 +- examples/warp_async/Makefile.toml | 15 - examples/warp_subscriptions/.gitignore | 1 - examples/warp_subscriptions/Cargo.toml | 17 +- examples/warp_subscriptions/Makefile.toml | 15 - integration_tests/async_await/Cargo.toml | 11 - integration_tests/async_await/src/main.rs | 167 --- integration_tests/codegen_fail/Makefile.toml | 29 - ...tr_additional_non_nullable_argument.stderr | 7 - .../attr_field_non_output_return_type.stderr | 5 - .../struct/attr_missing_field.stderr | 7 - .../struct/attr_non_subtype_return.stderr | 7 - ...ve_additional_non_nullable_argument.stderr | 7 - ...derive_field_non_output_return_type.stderr | 5 - .../struct/derive_missing_field.stderr | 7 - .../struct/derive_non_subtype_return.stderr | 7 - .../additional_non_nullable_argument.stderr | 7 - .../trait/field_non_output_return_type.stderr | 5 - .../fail/interface/trait/missing_field.stderr | 7 - .../trait/missing_field_argument.stderr | 7 - .../interface/trait/non_subtype_return.stderr | 7 - .../trait/wrong_argument_type.stderr | 7 - .../object/argument_non_input_type.stderr | 26 - .../attr_field_non_output_return_type.stderr | 5 - ...derive_field_non_output_return_type.stderr | 5 - .../field_non_output_return_type.stderr | 5 - .../fail/union/enum_non_object_variant.stderr | 7 - .../union/struct_non_object_variant.stderr | 7 - .../union/trait_non_object_variant.stderr | 7 - integration_tests/juniper_tests/Makefile.toml | 12 - juniper/CHANGELOG.md | 982 ++---------------- juniper/Cargo.toml | 33 +- juniper/LICENSE | 25 + juniper/Makefile.toml | 30 - juniper/README.md | 105 ++ juniper/release.toml | 127 ++- juniper/src/lib.rs | 103 +- juniper/src/schema/meta.rs | 18 +- juniper/src/schema/model.rs | 21 +- juniper/src/schema/translate/mod.rs | 2 +- juniper_actix/.gitignore | 4 - juniper_actix/CHANGELOG.md | 38 +- juniper_actix/Cargo.toml | 33 +- juniper_actix/LICENSE | 2 +- juniper_actix/Makefile.toml | 16 - juniper_actix/README.md | 51 +- juniper_actix/release.toml | 11 + juniper_actix/src/lib.rs | 41 +- juniper_benchmarks/.gitignore | 3 - juniper_benchmarks/CHANGELOG.md | 0 juniper_benchmarks/Makefile.toml | 12 - juniper_codegen/CHANGELOG.md | 55 + juniper_codegen/Cargo.toml | 17 +- juniper_codegen/LICENSE | 25 + juniper_codegen/Makefile.toml | 11 - juniper_codegen/README.md | 24 + juniper_codegen/release.toml | 24 +- juniper_codegen/src/common/field/arg.rs | 16 +- juniper_codegen/src/lib.rs | 8 +- juniper_graphql_ws/CHANGELOG.md | 30 +- juniper_graphql_ws/Cargo.toml | 16 +- juniper_graphql_ws/LICENSE | 25 + juniper_graphql_ws/Makefile.toml | 33 - juniper_graphql_ws/README.md | 24 + juniper_graphql_ws/release.toml | 31 +- juniper_graphql_ws/src/lib.rs | 9 +- juniper_hyper/.gitignore | 2 - juniper_hyper/CHANGELOG.md | 72 +- juniper_hyper/Cargo.toml | 13 +- juniper_hyper/LICENSE | 2 +- juniper_hyper/README.md | 46 +- juniper_hyper/release.toml | 17 + juniper_hyper/src/lib.rs | 2 +- juniper_iron/.gitignore | 2 - juniper_iron/CHANGELOG.md | 70 +- juniper_iron/Cargo.toml | 19 +- juniper_iron/LICENSE | 4 +- juniper_iron/README.md | 46 +- juniper_iron/release.toml | 17 + juniper_iron/src/lib.rs | 108 +- juniper_rocket/.gitignore | 2 - juniper_rocket/CHANGELOG.md | 101 +- juniper_rocket/Cargo.toml | 11 +- juniper_rocket/LICENSE | 4 +- juniper_rocket/README.md | 46 +- juniper_rocket/release.toml | 17 + juniper_rocket/src/lib.rs | 45 +- juniper_subscriptions/.gitignore | 4 - juniper_subscriptions/CHANGELOG.md | 27 +- juniper_subscriptions/Cargo.toml | 13 +- juniper_subscriptions/LICENSE | 2 +- juniper_subscriptions/Makefile.toml | 33 - juniper_subscriptions/README.md | 50 +- juniper_subscriptions/release.toml | 30 +- juniper_subscriptions/src/lib.rs | 11 +- juniper_warp/.gitignore | 4 - juniper_warp/CHANGELOG.md | 77 +- juniper_warp/Cargo.toml | 23 +- juniper_warp/LICENSE | 2 +- juniper_warp/Makefile.toml | 22 - juniper_warp/README.md | 46 +- juniper_warp/release.toml | 17 + juniper_warp/src/lib.rs | 41 +- release.toml | 3 + .../codegen_fail => tests/codegen}/Cargo.toml | 12 +- .../codegen}/fail/enum/derive_no_fields.rs | 0 .../fail/enum/derive_no_fields.stderr | 0 .../derive_incompatible_object.rs | 0 .../derive_incompatible_object.stderr | 31 + .../fail/input-object/derive_no_fields.rs | 0 .../fail/input-object/derive_no_fields.stderr | 0 .../fail/input-object/derive_no_underscore.rs | 0 .../input-object/derive_no_underscore.stderr | 0 .../fail/input-object/derive_unique_name.rs | 0 .../input-object/derive_unique_name.stderr | 0 .../fail/interface/attr_wrong_item.rs | 0 .../fail/interface/attr_wrong_item.stderr | 0 .../fail/interface/derive_wrong_item.rs | 0 .../fail/interface/derive_wrong_item.stderr | 0 .../attr_additional_non_nullable_argument.rs | 0 ...tr_additional_non_nullable_argument.stderr | 15 + .../struct/attr_field_double_underscored.rs | 0 .../attr_field_double_underscored.stderr | 0 .../attr_field_non_output_return_type.rs | 0 .../attr_field_non_output_return_type.stderr | 16 + .../interface/struct/attr_fields_duplicate.rs | 0 .../struct/attr_fields_duplicate.stderr | 0 .../attr_implementers_duplicate_pretty.rs | 0 .../attr_implementers_duplicate_pretty.stderr | 0 .../attr_implementers_duplicate_ugly.rs | 0 .../attr_implementers_duplicate_ugly.stderr | 0 .../interface/struct/attr_missing_field.rs | 0 .../struct/attr_missing_field.stderr | 63 ++ .../interface/struct/attr_missing_for_attr.rs | 0 .../struct/attr_missing_for_attr.stderr | 0 .../struct/attr_missing_impl_attr.rs | 0 .../struct/attr_missing_impl_attr.stderr | 0 .../struct/attr_name_double_underscored.rs | 0 .../attr_name_double_underscored.stderr | 0 .../fail/interface/struct/attr_no_fields.rs | 0 .../interface/struct/attr_no_fields.stderr | 0 .../struct/attr_non_subtype_return.rs | 0 .../struct/attr_non_subtype_return.stderr | 15 + .../interface/struct/attr_unnamed_field.rs | 0 .../struct/attr_unnamed_field.stderr | 0 ...derive_additional_non_nullable_argument.rs | 0 ...ve_additional_non_nullable_argument.stderr | 15 + .../struct/derive_field_double_underscored.rs | 0 .../derive_field_double_underscored.stderr | 0 .../derive_field_non_output_return_type.rs | 0 ...derive_field_non_output_return_type.stderr | 16 + .../struct/derive_fields_duplicate.rs | 0 .../struct/derive_fields_duplicate.stderr | 0 .../derive_implementers_duplicate_pretty.rs | 0 ...erive_implementers_duplicate_pretty.stderr | 0 .../derive_implementers_duplicate_ugly.rs | 0 .../derive_implementers_duplicate_ugly.stderr | 0 .../interface/struct/derive_missing_field.rs | 0 .../struct/derive_missing_field.stderr | 63 ++ .../struct/derive_missing_for_attr.rs | 0 .../struct/derive_missing_for_attr.stderr | 0 .../struct/derive_missing_impl_attr.rs | 0 .../struct/derive_missing_impl_attr.stderr | 0 .../struct/derive_name_double_underscored.rs | 0 .../derive_name_double_underscored.stderr | 0 .../fail/interface/struct/derive_no_fields.rs | 0 .../interface/struct/derive_no_fields.stderr | 0 .../struct/derive_non_subtype_return.rs | 0 .../struct/derive_non_subtype_return.stderr | 15 + .../interface/struct/derive_unnamed_field.rs | 0 .../struct/derive_unnamed_field.stderr | 0 .../trait/additional_non_nullable_argument.rs | 0 .../additional_non_nullable_argument.stderr | 15 + .../trait/argument_double_underscored.rs | 0 .../trait/argument_double_underscored.stderr | 0 .../trait/argument_non_input_type.rs | 0 .../trait/argument_non_input_type.stderr | 21 + .../trait/argument_wrong_default_array.rs | 0 .../trait/argument_wrong_default_array.stderr | 8 +- .../trait/field_double_underscored.rs | 0 .../trait/field_double_underscored.stderr | 0 .../trait/field_non_output_return_type.rs | 0 .../trait/field_non_output_return_type.stderr | 16 + .../fail/interface/trait/fields_duplicate.rs | 0 .../interface/trait/fields_duplicate.stderr | 0 .../trait/implementers_duplicate_pretty.rs | 0 .../implementers_duplicate_pretty.stderr | 0 .../trait/implementers_duplicate_ugly.rs | 0 .../trait/implementers_duplicate_ugly.stderr | 0 .../interface/trait/method_default_impl.rs | 0 .../trait/method_default_impl.stderr | 0 .../fail/interface/trait/missing_field.rs | 0 .../fail/interface/trait/missing_field.stderr | 63 ++ .../interface/trait/missing_field_argument.rs | 0 .../trait/missing_field_argument.stderr | 15 + .../fail/interface/trait/missing_for_attr.rs | 0 .../interface/trait/missing_for_attr.stderr | 0 .../fail/interface/trait/missing_impl_attr.rs | 0 .../interface/trait/missing_impl_attr.stderr | 0 .../trait/name_double_underscored.rs | 0 .../trait/name_double_underscored.stderr | 0 .../fail/interface/trait/no_fields.rs | 0 .../fail/interface/trait/no_fields.stderr | 0 .../interface/trait/non_subtype_return.rs | 0 .../interface/trait/non_subtype_return.stderr | 15 + .../interface/trait/wrong_argument_type.rs | 0 .../trait/wrong_argument_type.stderr | 15 + .../object/argument_double_underscored.rs | 0 .../object/argument_double_underscored.stderr | 0 .../fail/object/argument_non_input_type.rs | 0 .../object/argument_non_input_type.stderr | 57 + .../object/argument_wrong_default_array.rs | 0 .../argument_wrong_default_array.stderr | 8 +- .../object/attr_field_double_underscored.rs | 0 .../attr_field_double_underscored.stderr | 0 .../attr_field_non_output_return_type.rs | 0 .../attr_field_non_output_return_type.stderr | 16 + .../fail/object/attr_fields_duplicate.rs | 0 .../fail/object/attr_fields_duplicate.stderr | 0 .../object/attr_name_double_underscored.rs | 0 .../attr_name_double_underscored.stderr | 0 .../codegen}/fail/object/attr_no_fields.rs | 0 .../fail/object/attr_no_fields.stderr | 0 .../codegen}/fail/object/attr_wrong_item.rs | 0 .../fail/object/attr_wrong_item.stderr | 0 .../object/derive_field_double_underscored.rs | 0 .../derive_field_double_underscored.stderr | 0 .../derive_field_non_output_return_type.rs | 0 ...derive_field_non_output_return_type.stderr | 16 + .../fail/object/derive_fields_duplicate.rs | 0 .../object/derive_fields_duplicate.stderr | 0 .../object/derive_name_double_underscored.rs | 0 .../derive_name_double_underscored.stderr | 0 .../codegen}/fail/object/derive_no_fields.rs | 0 .../fail/object/derive_no_fields.stderr | 0 .../codegen}/fail/object/derive_wrong_item.rs | 0 .../fail/object/derive_wrong_item.stderr | 0 .../scalar/derive_input/attr_invalid_url.rs | 0 .../derive_input/attr_invalid_url.stderr | 0 .../derive_input/attr_transparent_and_with.rs | 0 .../attr_transparent_and_with.stderr | 0 .../attr_transparent_multiple_named_fields.rs | 0 ...r_transparent_multiple_named_fields.stderr | 0 ...ttr_transparent_multiple_unnamed_fields.rs | 0 ...transparent_multiple_unnamed_fields.stderr | 0 .../attr_transparent_unit_struct.rs | 0 .../attr_transparent_unit_struct.stderr | 0 .../scalar/derive_input/derive_invalid_url.rs | 0 .../derive_input/derive_invalid_url.stderr | 0 .../derive_transparent_and_with.rs | 0 .../derive_transparent_and_with.stderr | 0 ...erive_transparent_multiple_named_fields.rs | 0 ...e_transparent_multiple_named_fields.stderr | 0 ...ive_transparent_multiple_unnamed_fields.rs | 0 ...transparent_multiple_unnamed_fields.stderr | 0 .../derive_transparent_unit_struct.rs | 0 .../derive_transparent_unit_struct.stderr | 0 .../scalar/type_alias/attr_invalid_url.rs | 0 .../scalar/type_alias/attr_invalid_url.stderr | 0 .../type_alias/attr_with_not_all_resolvers.rs | 0 .../attr_with_not_all_resolvers.stderr | 0 .../type_alias/attr_without_resolvers.rs | 0 .../type_alias/attr_without_resolvers.stderr | 0 .../fail/scalar_value/missing_attributes.rs | 0 .../scalar_value/missing_attributes.stderr | 2 +- .../scalar_value/multiple_named_fields.rs | 0 .../scalar_value/multiple_named_fields.stderr | 0 .../scalar_value/multiple_unnamed_fields.rs | 0 .../multiple_unnamed_fields.stderr | 0 .../codegen}/fail/scalar_value/not_enum.rs | 0 .../fail/scalar_value/not_enum.stderr | 0 .../argument_double_underscored.rs | 0 .../argument_double_underscored.stderr | 0 .../subscription/argument_non_input_type.rs | 0 .../argument_non_input_type.stderr | 31 + .../argument_wrong_default_array.rs | 0 .../argument_wrong_default_array.stderr | 8 +- .../subscription/field_double_underscored.rs | 0 .../field_double_underscored.stderr | 0 .../field_non_output_return_type.rs | 0 .../field_non_output_return_type.stderr | 16 + .../fail/subscription/field_not_async.rs | 0 .../fail/subscription/field_not_async.stderr | 0 .../fail/subscription/fields_duplicate.rs | 0 .../fail/subscription/fields_duplicate.stderr | 0 .../subscription/name_double_underscored.rs | 0 .../name_double_underscored.stderr | 0 .../codegen}/fail/subscription/no_fields.rs | 0 .../fail/subscription/no_fields.stderr | 0 .../codegen}/fail/subscription/wrong_item.rs | 0 .../fail/subscription/wrong_item.stderr | 0 .../codegen}/fail/union/attr_wrong_item.rs | 0 .../fail/union/attr_wrong_item.stderr | 0 .../codegen}/fail/union/derive_wrong_item.rs | 0 .../fail/union/derive_wrong_item.stderr | 0 ...licts_with_variant_external_resolver_fn.rs | 0 ...s_with_variant_external_resolver_fn.stderr | 0 .../union/enum_name_double_underscored.rs | 0 .../union/enum_name_double_underscored.stderr | 0 .../codegen}/fail/union/enum_no_fields.rs | 0 .../codegen}/fail/union/enum_no_fields.stderr | 0 .../fail/union/enum_non_object_variant.rs | 0 .../fail/union/enum_non_object_variant.stderr | 17 + .../fail/union/enum_same_type_pretty.rs | 0 .../fail/union/enum_same_type_pretty.stderr | 0 .../fail/union/enum_same_type_ugly.rs | 0 .../fail/union/enum_same_type_ugly.stderr | 0 .../fail/union/enum_wrong_variant_field.rs | 0 .../union/enum_wrong_variant_field.stderr | 0 .../union/struct_name_double_underscored.rs | 0 .../struct_name_double_underscored.stderr | 0 .../codegen}/fail/union/struct_no_fields.rs | 0 .../fail/union/struct_no_fields.stderr | 0 .../fail/union/struct_non_object_variant.rs | 0 .../union/struct_non_object_variant.stderr | 17 + .../fail/union/struct_same_type_pretty.rs | 0 .../fail/union/struct_same_type_pretty.stderr | 0 .../fail/union/struct_same_type_ugly.rs | 0 .../fail/union/struct_same_type_ugly.stderr | 0 .../fail/union/trait_fail_infer_context.rs | 0 .../union/trait_fail_infer_context.stderr | 3 + ...hod_conflicts_with_external_resolver_fn.rs | 0 ...conflicts_with_external_resolver_fn.stderr | 0 .../union/trait_name_double_underscored.rs | 0 .../trait_name_double_underscored.stderr | 0 .../codegen}/fail/union/trait_no_fields.rs | 0 .../fail/union/trait_no_fields.stderr | 0 .../fail/union/trait_non_object_variant.rs | 0 .../union/trait_non_object_variant.stderr | 17 + .../fail/union/trait_same_type_pretty.rs | 0 .../fail/union/trait_same_type_pretty.stderr | 0 .../fail/union/trait_same_type_ugly.rs | 0 .../fail/union/trait_same_type_ugly.stderr | 0 .../fail/union/trait_with_attr_on_method.rs | 0 .../union/trait_with_attr_on_method.stderr | 0 .../union/trait_wrong_method_input_args.rs | 0 .../trait_wrong_method_input_args.stderr | 0 .../union/trait_wrong_method_return_type.rs | 0 .../trait_wrong_method_return_type.stderr | 0 .../codegen_fail => tests/codegen}/src/lib.rs | 0 .../integration}/Cargo.toml | 8 +- .../integration}/src/arc_fields.rs | 0 .../integration}/src/array.rs | 0 .../integration}/src/codegen/derive_enum.rs | 0 .../src/codegen/derive_input_object.rs | 0 .../codegen/derive_object_with_raw_idents.rs | 0 .../src/codegen/interface_attr_struct.rs | 0 .../src/codegen/interface_attr_trait.rs | 0 .../src/codegen/interface_derive.rs | 0 .../integration}/src/codegen/mod.rs | 0 .../integration}/src/codegen/object_attr.rs | 0 .../integration}/src/codegen/object_derive.rs | 0 .../src/codegen/scalar_attr_derive_input.rs | 0 .../src/codegen/scalar_attr_type_alias.rs | 0 .../integration}/src/codegen/scalar_derive.rs | 0 .../src/codegen/scalar_value_derive.rs | 0 .../src/codegen/subscription_attr.rs | 0 .../integration}/src/codegen/union_attr.rs | 0 .../integration}/src/codegen/union_derive.rs | 0 .../integration}/src/custom_scalar.rs | 0 .../integration}/src/explicit_null.rs | 0 .../src/infallible_as_field_error.rs | 0 .../integration}/src/issue_371.rs | 0 .../integration}/src/issue_372.rs | 0 .../integration}/src/issue_398.rs | 0 .../integration}/src/issue_407.rs | 0 .../integration}/src/issue_500.rs | 0 .../integration}/src/issue_798.rs | 0 .../integration}/src/issue_914.rs | 0 .../integration}/src/issue_922.rs | 0 .../integration}/src/issue_925.rs | 0 .../integration}/src/issue_945.rs | 0 .../integration}/src/lib.rs | 0 .../integration}/src/pre_parse.rs | 0 442 files changed, 2385 insertions(+), 3169 deletions(-) delete mode 100644 .github/workflows/book.yml rename rustfmt.toml => .rustfmt.toml (100%) create mode 100644 Makefile delete mode 100644 Makefile.toml delete mode 100644 _build/azure-pipelines-template.yml delete mode 100644 _build/cargo-make.ps1 delete mode 100755 _build/cargo-make.sh delete mode 100644 _build/release.toml delete mode 100644 _build/travis-juniper.enc delete mode 100644 azure-pipelines.yml rename {juniper_benchmarks => benches}/Cargo.toml (73%) rename {juniper_benchmarks => benches}/benches/benchmark.rs (100%) rename {juniper_benchmarks => benches}/src/lib.rs (100%) create mode 100644 book/.gitignore create mode 100644 book/README.md create mode 100644 book/book.toml rename {docs/book/content => book/src}/README.md (100%) rename {docs/book/content => book/src}/SUMMARY.md (100%) rename {docs/book/content => book/src}/advanced/dataloaders.md (98%) rename {docs/book/content => book/src}/advanced/implicit_and_explicit_null.md (100%) rename {docs/book/content => book/src}/advanced/index.md (100%) rename {docs/book/content => book/src}/advanced/introspection.md (100%) rename {docs/book/content => book/src}/advanced/multiple_ops_per_request.md (100%) rename {docs/book/content => book/src}/advanced/non_struct_objects.md (100%) rename {docs/book/content => book/src}/advanced/objects_and_generics.md (100%) rename {docs/book/content => book/src}/advanced/subscriptions.md (97%) rename {docs/book/content => book/src}/quickstart.md (99%) rename {docs/book/content => book/src}/schema/schemas_and_mutations.md (99%) rename {docs/book/content => book/src}/servers/hyper.md (95%) rename {docs/book/content => book/src}/servers/index.md (100%) rename {docs/book/content => book/src}/servers/iron.md (98%) rename {docs/book/content => book/src}/servers/official.md (100%) rename {docs/book/content => book/src}/servers/rocket.md (94%) rename {docs/book/content => book/src}/servers/third-party.md (100%) rename {docs/book/content => book/src}/servers/warp.md (95%) rename {docs/book/content => book/src}/styles/website.css (100%) rename {docs/book/content => book/src}/types/enums.md (100%) rename {docs/book/content => book/src}/types/index.md (100%) rename {docs/book/content => book/src}/types/input_objects.md (100%) rename {docs/book/content => book/src}/types/interfaces.md (100%) rename {docs/book/content => book/src}/types/objects/complex_fields.md (100%) rename {docs/book/content => book/src}/types/objects/defining_objects.md (100%) rename {docs/book/content => book/src}/types/objects/error_handling.md (100%) rename {docs/book/content => book/src}/types/objects/using_contexts.md (100%) rename {docs/book/content => book/src}/types/other-index.md (100%) rename {docs/book/content => book/src}/types/scalars.md (100%) rename {docs/book/content => book/src}/types/unions.md (100%) create mode 100644 book/tests/Cargo.toml create mode 100644 book/tests/build.rs rename {docs/book => book}/tests/src/lib.rs (100%) delete mode 100644 docs/book/.gitignore delete mode 100644 docs/book/README.md delete mode 100644 docs/book/book.toml delete mode 100755 docs/book/ci-build.sh delete mode 100644 docs/book/tests/.gitignore delete mode 100644 docs/book/tests/Cargo.toml delete mode 100644 docs/book/tests/build.rs delete mode 100644 examples/actix_subscriptions/Makefile.toml delete mode 100644 examples/basic_subscriptions/.gitignore delete mode 100644 examples/basic_subscriptions/Makefile.toml delete mode 100644 examples/warp_async/.gitignore delete mode 100644 examples/warp_async/Makefile.toml delete mode 100644 examples/warp_subscriptions/.gitignore delete mode 100644 examples/warp_subscriptions/Makefile.toml delete mode 100644 integration_tests/async_await/Cargo.toml delete mode 100644 integration_tests/async_await/src/main.rs delete mode 100644 integration_tests/codegen_fail/Makefile.toml delete mode 100644 integration_tests/codegen_fail/fail/interface/struct/attr_additional_non_nullable_argument.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/struct/attr_field_non_output_return_type.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/struct/attr_missing_field.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/struct/attr_non_subtype_return.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/struct/derive_additional_non_nullable_argument.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/struct/derive_field_non_output_return_type.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/struct/derive_missing_field.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/struct/derive_non_subtype_return.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/trait/additional_non_nullable_argument.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/trait/field_non_output_return_type.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/trait/missing_field.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/trait/missing_field_argument.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/trait/non_subtype_return.stderr delete mode 100644 integration_tests/codegen_fail/fail/interface/trait/wrong_argument_type.stderr delete mode 100644 integration_tests/codegen_fail/fail/object/argument_non_input_type.stderr delete mode 100644 integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.stderr delete mode 100644 integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.stderr delete mode 100644 integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.stderr delete mode 100644 integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr delete mode 100644 integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr delete mode 100644 integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr delete mode 100644 integration_tests/juniper_tests/Makefile.toml create mode 100644 juniper/LICENSE delete mode 100644 juniper/Makefile.toml create mode 100644 juniper/README.md delete mode 100644 juniper_actix/.gitignore delete mode 100644 juniper_actix/Makefile.toml create mode 100644 juniper_actix/release.toml delete mode 100644 juniper_benchmarks/.gitignore delete mode 100644 juniper_benchmarks/CHANGELOG.md delete mode 100644 juniper_benchmarks/Makefile.toml create mode 100644 juniper_codegen/CHANGELOG.md create mode 100644 juniper_codegen/LICENSE delete mode 100644 juniper_codegen/Makefile.toml create mode 100644 juniper_codegen/README.md create mode 100644 juniper_graphql_ws/LICENSE delete mode 100644 juniper_graphql_ws/Makefile.toml create mode 100644 juniper_graphql_ws/README.md delete mode 100644 juniper_hyper/.gitignore create mode 100644 juniper_hyper/release.toml delete mode 100644 juniper_iron/.gitignore create mode 100644 juniper_iron/release.toml delete mode 100644 juniper_rocket/.gitignore create mode 100644 juniper_rocket/release.toml delete mode 100644 juniper_subscriptions/.gitignore delete mode 100644 juniper_subscriptions/Makefile.toml delete mode 100644 juniper_warp/.gitignore delete mode 100644 juniper_warp/Makefile.toml create mode 100644 juniper_warp/release.toml create mode 100644 release.toml rename {integration_tests/codegen_fail => tests/codegen}/Cargo.toml (54%) rename {integration_tests/codegen_fail => tests/codegen}/fail/enum/derive_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/enum/derive_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/input-object/derive_incompatible_object.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/input-object/derive_incompatible_object.stderr (61%) rename {integration_tests/codegen_fail => tests/codegen}/fail/input-object/derive_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/input-object/derive_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/input-object/derive_no_underscore.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/input-object/derive_no_underscore.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/input-object/derive_unique_name.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/input-object/derive_unique_name.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/attr_wrong_item.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/attr_wrong_item.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/derive_wrong_item.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/derive_wrong_item.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_additional_non_nullable_argument.rs (100%) create mode 100644 tests/codegen/fail/interface/struct/attr_additional_non_nullable_argument.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_field_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_field_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_field_non_output_return_type.rs (100%) create mode 100644 tests/codegen/fail/interface/struct/attr_field_non_output_return_type.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_fields_duplicate.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_fields_duplicate.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_implementers_duplicate_pretty.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_implementers_duplicate_pretty.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_implementers_duplicate_ugly.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_implementers_duplicate_ugly.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_missing_field.rs (100%) create mode 100644 tests/codegen/fail/interface/struct/attr_missing_field.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_missing_for_attr.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_missing_for_attr.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_missing_impl_attr.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_missing_impl_attr.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_non_subtype_return.rs (100%) create mode 100644 tests/codegen/fail/interface/struct/attr_non_subtype_return.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_unnamed_field.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/attr_unnamed_field.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_additional_non_nullable_argument.rs (100%) create mode 100644 tests/codegen/fail/interface/struct/derive_additional_non_nullable_argument.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_field_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_field_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_field_non_output_return_type.rs (100%) create mode 100644 tests/codegen/fail/interface/struct/derive_field_non_output_return_type.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_fields_duplicate.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_fields_duplicate.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_implementers_duplicate_pretty.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_implementers_duplicate_pretty.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_implementers_duplicate_ugly.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_implementers_duplicate_ugly.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_missing_field.rs (100%) create mode 100644 tests/codegen/fail/interface/struct/derive_missing_field.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_missing_for_attr.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_missing_for_attr.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_missing_impl_attr.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_missing_impl_attr.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_non_subtype_return.rs (100%) create mode 100644 tests/codegen/fail/interface/struct/derive_non_subtype_return.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_unnamed_field.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/struct/derive_unnamed_field.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/additional_non_nullable_argument.rs (100%) create mode 100644 tests/codegen/fail/interface/trait/additional_non_nullable_argument.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/argument_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/argument_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/argument_non_input_type.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/argument_non_input_type.stderr (51%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/argument_wrong_default_array.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/argument_wrong_default_array.stderr (71%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/field_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/field_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/field_non_output_return_type.rs (100%) create mode 100644 tests/codegen/fail/interface/trait/field_non_output_return_type.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/fields_duplicate.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/fields_duplicate.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/implementers_duplicate_pretty.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/implementers_duplicate_pretty.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/implementers_duplicate_ugly.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/implementers_duplicate_ugly.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/method_default_impl.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/method_default_impl.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/missing_field.rs (100%) create mode 100644 tests/codegen/fail/interface/trait/missing_field.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/missing_field_argument.rs (100%) create mode 100644 tests/codegen/fail/interface/trait/missing_field_argument.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/missing_for_attr.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/missing_for_attr.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/missing_impl_attr.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/missing_impl_attr.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/non_subtype_return.rs (100%) create mode 100644 tests/codegen/fail/interface/trait/non_subtype_return.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/interface/trait/wrong_argument_type.rs (100%) create mode 100644 tests/codegen/fail/interface/trait/wrong_argument_type.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/object/argument_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/argument_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/argument_non_input_type.rs (100%) create mode 100644 tests/codegen/fail/object/argument_non_input_type.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/object/argument_wrong_default_array.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/argument_wrong_default_array.stderr (71%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_field_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_field_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_field_non_output_return_type.rs (100%) create mode 100644 tests/codegen/fail/object/attr_field_non_output_return_type.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_fields_duplicate.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_fields_duplicate.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_wrong_item.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/attr_wrong_item.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_field_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_field_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_field_non_output_return_type.rs (100%) create mode 100644 tests/codegen/fail/object/derive_field_non_output_return_type.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_fields_duplicate.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_fields_duplicate.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_wrong_item.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/object/derive_wrong_item.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_invalid_url.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_invalid_url.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_transparent_and_with.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_transparent_and_with.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_transparent_multiple_named_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_transparent_multiple_named_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_transparent_unit_struct.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/attr_transparent_unit_struct.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_invalid_url.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_invalid_url.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_transparent_and_with.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_transparent_and_with.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_transparent_multiple_named_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_transparent_multiple_named_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_transparent_unit_struct.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/derive_input/derive_transparent_unit_struct.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/type_alias/attr_invalid_url.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/type_alias/attr_invalid_url.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/type_alias/attr_with_not_all_resolvers.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/type_alias/attr_with_not_all_resolvers.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/type_alias/attr_without_resolvers.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar/type_alias/attr_without_resolvers.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar_value/missing_attributes.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar_value/missing_attributes.stderr (71%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar_value/multiple_named_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar_value/multiple_named_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar_value/multiple_unnamed_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar_value/multiple_unnamed_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar_value/not_enum.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/scalar_value/not_enum.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/argument_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/argument_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/argument_non_input_type.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/argument_non_input_type.stderr (50%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/argument_wrong_default_array.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/argument_wrong_default_array.stderr (71%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/field_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/field_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/field_non_output_return_type.rs (100%) create mode 100644 tests/codegen/fail/subscription/field_non_output_return_type.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/field_not_async.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/field_not_async.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/fields_duplicate.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/fields_duplicate.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/wrong_item.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/subscription/wrong_item.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/attr_wrong_item.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/attr_wrong_item.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/derive_wrong_item.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/derive_wrong_item.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_non_object_variant.rs (100%) create mode 100644 tests/codegen/fail/union/enum_non_object_variant.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_same_type_pretty.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_same_type_pretty.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_same_type_ugly.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_same_type_ugly.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_wrong_variant_field.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/enum_wrong_variant_field.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_non_object_variant.rs (100%) create mode 100644 tests/codegen/fail/union/struct_non_object_variant.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_same_type_pretty.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_same_type_pretty.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_same_type_ugly.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/struct_same_type_ugly.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_fail_infer_context.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_fail_infer_context.stderr (83%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_method_conflicts_with_external_resolver_fn.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_name_double_underscored.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_name_double_underscored.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_no_fields.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_no_fields.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_non_object_variant.rs (100%) create mode 100644 tests/codegen/fail/union/trait_non_object_variant.stderr rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_same_type_pretty.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_same_type_pretty.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_same_type_ugly.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_same_type_ugly.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_with_attr_on_method.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_with_attr_on_method.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_wrong_method_input_args.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_wrong_method_input_args.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_wrong_method_return_type.rs (100%) rename {integration_tests/codegen_fail => tests/codegen}/fail/union/trait_wrong_method_return_type.stderr (100%) rename {integration_tests/codegen_fail => tests/codegen}/src/lib.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/Cargo.toml (74%) rename {integration_tests/juniper_tests => tests/integration}/src/arc_fields.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/array.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/derive_enum.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/derive_input_object.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/derive_object_with_raw_idents.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/interface_attr_struct.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/interface_attr_trait.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/interface_derive.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/mod.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/object_attr.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/object_derive.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/scalar_attr_derive_input.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/scalar_attr_type_alias.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/scalar_derive.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/scalar_value_derive.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/subscription_attr.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/union_attr.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/codegen/union_derive.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/custom_scalar.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/explicit_null.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/infallible_as_field_error.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_371.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_372.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_398.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_407.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_500.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_798.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_914.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_922.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_925.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/issue_945.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/lib.rs (100%) rename {integration_tests/juniper_tests => tests/integration}/src/pre_parse.rs (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f75ce68a..1cf1a19b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,34 +1,11 @@ version: 2 updates: -- package-ecosystem: cargo - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 - ignore: - - dependency-name: warp - versions: - - 0.3.0 - - 0.3.1 - - dependency-name: tokio - versions: - - 1.1.0 - - 1.2.0 - - 1.3.0 - - 1.4.0 - - dependency-name: actix - versions: - - 0.11.0 - - dependency-name: actix-rt - versions: - - 2.0.0 - - 2.1.0 - - dependency-name: bytes - versions: - - 1.0.0 - - dependency-name: hyper - versions: - - 0.14.1 - - dependency-name: rand - versions: - - 0.8.0 + - package-ecosystem: cargo + directory: / + schedule: + interval: daily + + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml deleted file mode 100644 index d7869b5b..00000000 --- a/.github/workflows/book.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Book - -on: - pull_request: - paths: - - 'docs/book/**' - push: - paths: - - 'docs/book/**' - -jobs: - tests: - name: Test code examples - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Test via skeptic - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path docs/book/tests/Cargo.toml - - deploy: - name: Deploy book on gh-pages - needs: [tests] - if: github.ref == 'refs/heads/master' - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install mdBook - uses: peaceiris/actions-mdbook@v1 - - - name: Render book - run: | - mdbook build -d gh-pages/master docs/book - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - keepFiles: true - publish_dir: docs/book/gh-pages diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index babf3867..bde2bf27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,151 +1,370 @@ name: CI -on: [pull_request, push] +on: + push: + branches: ["master"] + tags: ["juniper*@*"] + pull_request: + branches: ["master"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: 1 jobs: - ################################################### - # Formatting - ################################################### - format: - name: Check formatting + ########################## + # Linting and formatting # + ########################## + clippy: + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/juniper') + || !contains(github.event.head_commit.message, '[skip ci]') }} runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install rust - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 with: - toolchain: stable - components: rustfmt profile: minimal - override: true + toolchain: stable + components: clippy - - name: Run rustfmt - uses: actions-rs/cargo@v1 + - run: make cargo.lint + + rustfmt: + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/juniper') + || !contains(github.event.head_commit.message, '[skip ci]') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 with: - command: fmt - args: -- --check + profile: minimal + toolchain: nightly + components: rustfmt - ################################################### - # Main Builds - ################################################### + - run: make cargo.fmt check=yes - build: - runs-on: ${{ matrix.os }} + + + ########### + # Testing # + ########### + + example: + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/juniper') + || !contains(github.event.head_commit.message, '[skip ci]') }} strategy: fail-fast: false matrix: - rust: [stable, beta, nightly] - os: [ubuntu-latest, windows-latest, macOS-latest] - + example: + - actix_subscriptions + - basic_subscriptions + - warp_async + - warp_subscriptions + os: + - ubuntu + - macOS + - windows + toolchain: + - stable + - beta + - nightly + runs-on: ${{ matrix.os }}-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install rust - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.rust }} profile: minimal + toolchain: ${{ matrix.toolchain }} override: true - - uses: davidB/rust-cargo-make@v1 + - run: cargo check -p example_${{ matrix.example }} + + feature: + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/juniper') + || !contains(github.event.head_commit.message, '[skip ci]') }} + strategy: + fail-fast: false + matrix: + include: + - { feature: , crate: juniper } + - { feature: bson, crate: juniper } + - { feature: chrono, crate: juniper } + - { feature: chrono-clock, crate: juniper } + - { feature: chrono-tz, crate: juniper } + - { feature: expose-test-schema, crate: juniper } + - { feature: graphql-parser, crate: juniper } + - { feature: schema-language, crate: juniper } + - { feature: serde_json, crate: juniper } + - { feature: time, crate: juniper } + - { feature: url, crate: juniper } + - { feature: uuid, crate: juniper } + - { feature: , crate: juniper_actix } + - { feature: subscriptions, crate: juniper_actix } + - { feature: , crate: juniper_warp } + - { feature: subscriptions, crate: juniper_warp } + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 with: - version: '0.20.0' + profile: minimal + toolchain: stable + override: true - - name: Build and run tests + # TODO: Enable once MSRV is supported. + #- run: cargo +nightly update -Z minimal-versions + + - run: cargo check -p ${{ matrix.crate }} --no-default-features + ${{ matrix.feature != '' + && format('--features {0}', matrix.feature) + || '' }} env: - CARGO_MAKE_RUN_CODECOV: true - run: | - cargo make workspace-ci-flow --no-workspace + RUSTFLAGS: -D warnings - ################################################### - # WASM Builds - ################################################### + package: + if: ${{ startsWith(github.ref, 'refs/tags/juniper') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - name: Parse crate name + id: crate + run: echo ::set-output + name=NAME::$(printf "$GITHUB_REF" | cut -d '/' -f3 + | cut -d '@' -f1) + + - run: cargo package -p ${{ steps.crate.outputs.NAME }} + + test: + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/juniper') + || !contains(github.event.head_commit.message, '[skip ci]') }} + strategy: + fail-fast: false + matrix: + crate: + - juniper_codegen + - juniper + - juniper_subscriptions + - juniper_graphql_ws + - juniper_integration_tests + - juniper_codegen_tests + - juniper_book_tests + - juniper_actix + - juniper_hyper + - juniper_iron + - juniper_rocket + - juniper_warp + os: + - ubuntu + - macOS + - windows + toolchain: + - stable + - beta + - nightly + exclude: + - crate: juniper_codegen_tests + toolchain: stable + - crate: juniper_codegen_tests + toolchain: beta + - crate: juniper_codegen_tests + os: macOS + - crate: juniper_codegen_tests + os: windows + - crate: juniper_book_tests + toolchain: beta + - crate: juniper_book_tests + toolchain: nightly + # TODO: LLVM ERROR: out of memory + - crate: juniper_integration_tests + os: windows + toolchain: beta + - crate: juniper_integration_tests + os: windows + toolchain: nightly + + runs-on: ${{ matrix.os }}-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + override: true + + - run: make test.cargo crate=${{ matrix.crate }} wasm: - runs-on: ${{ matrix.os }} - + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/juniper') + || !contains(github.event.head_commit.message, '[skip ci]') }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] - + crate: + - juniper_codegen + - juniper + toolchain: + - stable + - beta + - nightly + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install rust - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 with: - toolchain: stable - target: wasm32-unknown-unknown profile: minimal + toolchain: ${{ matrix.toolchain }} + target: wasm32-unknown-unknown override: true - - name: Check - uses: actions-rs/cargo@v1 + - run: cargo check --target wasm32-unknown-unknown -p ${{ matrix.crate }} + + + + + ############# + # Releasing # + ############# + + release-check: + name: Check release automation + if: ${{ !startsWith(github.ref, 'refs/tags/juniper') + && (github.ref == 'refs/heads/master' + || !contains(github.event.head_commit.message, '[skip ci]')) }} + strategy: + fail-fast: false + matrix: + crate: + - juniper_codegen + - juniper + - juniper_subscriptions + - juniper_graphql_ws + - juniper_actix + - juniper_hyper + - juniper_iron + - juniper_rocket + - juniper_warp + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 with: - command: check - args: --target wasm32-unknown-unknown --package juniper --package juniper_codegen + profile: minimal + toolchain: stable - ################################################### - # Releases - ################################################### + - run: cargo install cargo-release - #release: - # name: Check release automation + - run: make cargo.release crate=${{ matrix.crate }} ver=minor + exec=no install=no - # runs-on: ubuntu-latest + release-github: + name: Release on GitHub + needs: + - clippy + - example + - feature + - package + - rustfmt + - test + - wasm + if: ${{ startsWith(github.ref, 'refs/tags/juniper') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # with: - # fetch-depth: 20 + - name: Parse crate name + id: crate + run: echo ::set-output + name=NAME::$(printf "$GITHUB_REF" | cut -d '/' -f3 + | cut -d '@' -f1) + - name: Parse release version + id: release + run: echo ::set-output + name=VERSION::$(printf "$GITHUB_REF" | cut -d '@' -f2) - # - name: Install rust - # uses: actions-rs/toolchain@v1 - # with: - # toolchain: stable - # profile: minimal - # override: true + - name: Verify release version matches crate's Cargo manifest + run: >- + test "${{ steps.release.outputs.VERSION }}" \ + == "$(grep -m1 'version = "' ${{ steps.crate.outputs.NAME }}/Cargo.toml | cut -d '"' -f2)" + - name: Parse CHANGELOG link + id: changelog + run: echo ::set-output + name=LINK::https://github.com/${{ github.repository }}/blob/${{ steps.crate.outputs.NAME }}%40${{ steps.release.outputs.VERSION }}//${{ steps.crate.outputs.NAME }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.VERSION }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' ${{ steps.crate.outputs.NAME }}/CHANGELOG.md) - # - uses: davidB/rust-cargo-make@v1 - # with: - # version: '0.20.0' + - uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: ${{ steps.crate.outputs.NAME }} ${{ steps.release.outputs.VERSION }} + body: | + [API docs](https://docs.rs/${{ steps.crate.outputs.NAME }}/${{ steps.release.outputs.VERSION }}) + [Changelog](${{ steps.changelog.outputs.LINK }}) + prerelease: ${{ contains(steps.release.outputs.VERSION, '-') }} - # - name: Install cargo-release - # uses: actions-rs/cargo@v1 - # with: - # command: install - # args: --version=0.19.4 cargo-release + release-crate: + name: Release on crates.io + needs: ["release-github"] + if: ${{ startsWith(github.ref, 'refs/tags/juniper') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable - # - name: Setup git - # run: | - # git config --global user.email "juniper@example.com" - # git config --global user.name "Release Test Bot" + - name: Parse crate name + id: crate + run: echo ::set-output + name=NAME::$(printf "$GITHUB_REF" | cut -d '/' -f3 + | cut -d '@' -f1) - # - name: Dry run mode - # env: - # RELEASE_LEVEL: minor - # run: | - # cargo make release-dry-run + - name: Publish crate + run: cargo publish -p ${{ steps.crate.outputs.NAME }} + --token ${{ secrets.CRATESIO_TOKEN }} - # - name: Local test mode - # env: - # RELEASE_LEVEL: minor - # run: | - # cargo make release-local-test - # - name: Echo local changes - # run: | - # git --no-pager log -p HEAD...HEAD~20 - # - name: Run tests - # run: | - # cargo make workspace-ci-flow --no-workspace + + ########## + # Deploy # + ########## + + deploy-book: + name: deploy Book + needs: ["test"] + if: ${{ github.ref == 'refs/heads/master' + || startsWith(github.ref, 'refs/tags/juniper@') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: peaceiris/actions-mdbook@v1 + + - run: make book.build out=gh-pages/master + if: ${{ github.ref == 'refs/heads/master' }} + + - run: make book.build out=gh-pages + if: ${{ startsWith(github.ref, 'refs/tags/juniper@') }} + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + keep_files: true + publish_dir: book/gh-pages diff --git a/.gitignore b/.gitignore index 64f40ab2..1e25d8ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ -target -Cargo.lock -.idea +/.idea/ +/.vscode/ +/*.iml +.DS_Store + +/Cargo.lock +/target/ diff --git a/rustfmt.toml b/.rustfmt.toml similarity index 100% rename from rustfmt.toml rename to .rustfmt.toml diff --git a/Cargo.toml b/Cargo.toml index a64f814f..1a97d16a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,24 +1,20 @@ [workspace] -# Order is important as this is the order the crates will be released. members = [ - "juniper_benchmarks", - "juniper_codegen", - "juniper", - "examples/basic_subscriptions", - "examples/warp_async", - "examples/warp_subscriptions", - "examples/actix_subscriptions", - "integration_tests/juniper_tests", - "integration_tests/async_await", - "integration_tests/codegen_fail", - "juniper_hyper", - "juniper_iron", - "juniper_rocket", - "juniper_subscriptions", - "juniper_graphql_ws", - "juniper_warp", - "juniper_actix", -] -exclude = [ - "docs/book/tests", + "benches", + "book/tests", + "examples/basic_subscriptions", + "examples/warp_async", + "examples/warp_subscriptions", + "examples/actix_subscriptions", + "juniper_codegen", + "juniper", + "juniper_hyper", + "juniper_iron", + "juniper_rocket", + "juniper_subscriptions", + "juniper_graphql_ws", + "juniper_warp", + "juniper_actix", + "tests/codegen", + "tests/integration", ] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..e6a566bf --- /dev/null +++ b/Makefile @@ -0,0 +1,139 @@ +############################### +# Common defaults/definitions # +############################### + +comma := , + +# Checks two given strings for equality. +eq = $(if $(or $(1),$(2)),$(and $(findstring $(1),$(2)),\ + $(findstring $(2),$(1))),1) + + + + +########### +# Aliases # +########### + +book: book.build + + +fmt: cargo.fmt + + +lint: cargo.lint + + +test: test.cargo + + +release: cargo.release + + + + +################## +# Cargo commands # +################## + +# Format Rust sources with rustfmt. +# +# Usage: +# make cargo.fmt [check=(no|yes)] + +cargo.fmt: + cargo +nightly fmt --all $(if $(call eq,$(check),yes),-- --check,) + + +# Lint Rust sources with Clippy. +# +# Usage: +# make cargo.lint + +cargo.lint: + cargo clippy --workspace --all-features -- -D warnings + + +# Release Rust crate. +# +# Read more about bump levels here: +# https://github.com/crate-ci/cargo-release/blob/master/docs/reference.md#bump-level +# +# Usage: +# make cargo.release crate= [ver=(release|)] +# ([exec=no]|exec=yes [push=(yes|no)]) +# [install=(yes|no)] + +cargo.release: +ifneq ($(install),no) + cargo install cargo-release +endif + cargo release -p $(crate) --all-features \ + $(if $(call eq,$(exec),yes),\ + --no-publish $(if $(call eq,$(push),no),--no-push,) --execute,\ + -v $(if $(call eq,$(CI),),,--no-publish)) \ + $(or $(ver),release) + + +cargo.test: test.cargo + + + + +#################### +# Testing commands # +#################### + +# Run Rust tests of Book. +# +# Usage: +# make test.book + +test.book: + @make test.cargo crate=juniper_book_tests + + +# Run Rust tests of project crates. +# +# Usage: +# make test.cargo [crate=] + +test.cargo: + cargo $(if $(call eq,$(crate),juniper_codegen_tests),+nightly,) test \ + $(if $(call eq,$(crate),),--workspace,-p $(crate)) --all-features + + + + +################# +# Book commands # +################# + +# Build Book. +# +# Usage: +# make book.build [out=] + +book.build: + mdbook build book/ $(if $(call eq,$(out),),,-d $(out)) + + +# Serve Book on some port. +# +# Usage: +# make book.serve [port=(3000|)] + +book.serve: + mdbook serve book/ -p=$(or $(port),3000) + + + + +################## +# .PHONY section # +################## + +.PHONY: book fmt lint release test \ + book.build book.serve \ + cargo.fmt cargo.lint cargo.release cargo.test \ + test.book test.cargo diff --git a/Makefile.toml b/Makefile.toml deleted file mode 100644 index a23a63ba..00000000 --- a/Makefile.toml +++ /dev/null @@ -1,38 +0,0 @@ -# https://github.com/sagiegurari/cargo-make#automatically-extend-workspace-makefile -[env] -CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true" -CARGO_MAKE_CARGO_ALL_FEATURES = "" -CARGO_MAKE_WORKSPACE_SKIP_MEMBERS = "integration_tests/*;examples/*;juniper_benchmarks;" - - -# Run `RELEASE_LEVEL=(patch|major|minor) cargo make release` to push a new release of every crate. -# -# Run `RELEASE_LEVEL=(patch|major|minor) CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS="crate1;crate2;" cargo make release` -# to push a new release of a subset of crates. -[tasks.release] -condition = { env_set = [ "RELEASE_LEVEL" ] } -command = "cargo-release" -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/../_build/release.toml", "--execute", "${RELEASE_LEVEL}"] - - -# Run `RELEASE_LEVEL=(patch|major|minor) cargo make release-dry-run` to do a dry run. -# -# Run `RELEASE_LEVEL=(patch|major|minor) CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS="crate1;crate2;" cargo make release-dry-run` -# to do a dry run of a subset of crates. -[tasks.release-dry-run] -condition = { env_set = [ "RELEASE_LEVEL" ] } -description = "Run `cargo-release --dry-run` for every crate" -command = "cargo-release" -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/../_build/release.toml", "--no-confirm", "--no-publish", "--no-push", "--no-tag", "${RELEASE_LEVEL}"] - - -# Run `RELEASE_LEVEL=(patch|major|minor) cargo make release-local-test` to actually make changes locally but -# not push them up to crates.io or Github. -# -# Run `RELEASE_LEVEL=(patch|major|minor) CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS="crate1;crate2;" cargo make release-local-test` to actually make changes locally but -# not push some crates up to crates.io or Github. -[tasks.release-local-test] -condition = { env_set = [ "RELEASE_LEVEL" ] } -description = "Run `cargo-release` for every crate, but only make changes locally" -command = "cargo-release" -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/../_build/release.toml", "--no-confirm", "${RELEASE_LEVEL}"] diff --git a/RELEASING.md b/RELEASING.md index 4fa10761..1a869f6a 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,74 +1,59 @@ -# How to release new crate versions +Releasing new crate versions +============================ + +Releasing of [workspace] crates of this project is performed by pushing the Git release tag (having `@` format), following by the [CI pipeline] creating a [GitHub release] and publishing the crate to [crates.io]. + +> __WARNING__: Only one [workspace] crate may be released at a time. So, if you need to release multiple [workspace] crates, do this sequentially. + + + ## Prerequisites -It is generally best to start with a clean respository dedicated to a release so that no git weirdness happens: - -``` -git clone git@github.com:graphql-rust/juniper.git juniper_release; -cd juniper_release; +We use [`cargo-release`] to automate crate releases. You will need to install it locally: +```bash +cargo install cargo-release ``` -We use the `nightly` toolchain when releasing. This is because some of our crates require nightly: -`rustup default nightly` -We use [`cargo-make`](cargo-make) and [`cargo-release`](cargo-release) to automate crate releases. You will need to install them locally: -- `cargo install -f cargo-make` -- `cargo install -f cargo-release` +## Preparing -## Preparing for a release +To produce a new release a [workspace] crate, perform the following steps: -There are two general classes of releases: +1. Check its `CHANGELOG.md` file to be complete and correctly formatted. The section for the new release __should start__ with `## master` header. Commit any changes you've made. -1. All public workspace crates should be released and all share the same release level ("patch", "minor", "major"). +2. Determine a new release [bump level] (`patch`, `minor`, `major`, or default `release`). -2. A subset of workspace crates need to be released, or not all crate releases share the same release level. +3. Run the release process in dry-run mode and check the produced diffs to be made in the returned output. + ```bash + make release crate=juniper ver=minor + ``` -**All release commands must be run from the root directory of the repository.** +4. (Optional) Not everything may be captured in dry-run mode. It may be a good idea to run a local test, without pushing the created Git commit and tag. + ```bash + make release crate=juniper ver=minor exec=yes push=no + ``` -## Determine new release level -For each crate, determine the desired release level (`patch`, `minor`, `major`). Set the `RELEASE_LEVEL` env variable to the desired release level. -## Determine which crates to release -If a subset of workspace crates need to be released, or not all crate releases share the same release level, set the `CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS` env -variable to choose specific workspace crates. The value is a list of semicolon-delineated crate names or a regular expressions. +## Executing -## Dry run +Once everything is prepared and checked, just execute the releasing process: +```bash +make release crate=juniper ver=minor exec=yes +``` -It is a good idea to do a dry run to sanity check what actions will be performed. +Once the [CI pipeline] for the pushed Git tag successfully finishes, the crate is fully released. -- For case #1 above, run `cargo make release-dry-run`. -- For case #2 above, run `CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS="crate1;crate2" cargo make release-dry-run`. - If the command finishes super quickly with no output you likely did not set `RELEASE_LEVEL`. -## Local test -Not everything is captured in the dry run. It is a good idea to run a local test. -In a local test, all the release actions are performed on your local checkout -but nothing is pushed to Github or crates.io. - -- For case #1 above, run `cargo make release-local-test`. -- For case #2 above, run `CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS="crate1;crate2" cargo make release-local-test`. - - If the command finishes super quickly with no output you likely did not set `RELEASE_LEVEL`. - -After, your local git repository should have the changes ready to push to Github. -Use `git rebase -i HEAD~10` and drop the new commits. - -## Release - -After testing locally and via a dry run, it is time to release. A release -consists of bumping versions, starting a new changelog section, pushing a tag to Github, and updating crates.io. This should all be handled by running the automated commands. - -- For case #1 above, run `cargo make release`. -- For case #2 above, run `CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS="crate1;crate2" cargo make release`. - - If the command finishes super quickly with no output you likely did not set `RELEASE_LEVEL`, - -[cargo-make]: https://github.com/sagiegurari/cargo-make -[cargo-release]: https://github.com/sunng87/cargo-release +[`cargo-release`]: https://crates.io/crates/cargo-release +[CI pipeline]: /../../blob/master/.github/workflows/ci.yml +[crates.io]: https://crates.io +[GitHub release]: https://docs.github.com/repositories/releasing-projects-on-github/about-releases +[release level]: https://github.com/crate-ci/cargo-release/blob/master/docs/reference.md#bump-level +[workspace]: https://doc.rust-lang.org/cargo/reference/workspaces.html diff --git a/_build/azure-pipelines-template.yml b/_build/azure-pipelines-template.yml deleted file mode 100644 index 0352a9eb..00000000 --- a/_build/azure-pipelines-template.yml +++ /dev/null @@ -1,71 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - pool: - vmImage: ${{ parameters.vmImage }} - strategy: - matrix: - stable: - rustup_toolchain: stable - beta: - rustup_toolchain: beta - nightly: - rustup_toolchain: nightly - # TODO: re-enable once new versions are released. - # minimum_supported_version_plus_one: - # rustup_toolchain: 1.32.0 - #minimum_supported_version: - # rustup_toolchain: 1.33.0 - steps: - - ${{ if ne(parameters.name, 'Windows') }}: - # Linux and macOS. - - script: | - export CARGO_HOME="$HOME/.cargo" - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN - echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" - displayName: Install rust - - ${{ if eq(parameters.name, 'Windows') }}: - # Windows. - - script: | - set CARGO_HOME=%USERPROFILE%\.cargo - curl -sSf -o rustup-init.exe https://win.rustup.rs - rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN% - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" - displayName: Install rust (windows) - # All platforms. - - script: | - rustc -Vv - cargo -V - displayName: Query rust and cargo versions - - ${{ if eq(parameters.name, 'Linux') }}: - # Linux. - - script: _build/cargo-make.sh "0.20.0" "x86_64-unknown-linux-musl" - displayName: Install cargo-make binary - - ${{ if eq(parameters.name, 'macOS') }}: - # Mac. - - script: _build/cargo-make.sh "0.20.0" "x86_64-apple-darwin" - displayName: Install cargo-make binary - - ${{ if eq(parameters.name, 'Windows') }}: - # Windows. - - script: powershell -executionpolicy bypass -file _build/cargo-make.ps1 -version "0.20.0" -target "x86_64-pc-windows-msvc" - displayName: Install cargo-make binary - - ${{ if eq(parameters.name, 'Windows') }}: - # Windows. - - script: | - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - cargo make workspace-ci-flow --no-workspace - env: { CARGO_MAKE_RUN_CODECOV: true } - displayName: Build and run tests - - ${{ if ne(parameters.name, 'Windows') }}: - # Not Windows. - - script: | - export PATH="$PATH:$HOME/.cargo/bin"; - cargo make workspace-ci-flow --no-workspace - env: { CARGO_MAKE_RUN_CODECOV: true } - displayName: Build and run tests - - - script: | - rustup target add wasm32-unknown-unknown - cargo check --target wasm32-unknown-unknown --package juniper --package juniper_codegen - displayName: Check WebAssembly target - condition: eq(variables['rustup_toolchain'], 'stable') diff --git a/_build/cargo-make.ps1 b/_build/cargo-make.ps1 deleted file mode 100644 index a1c7b5d6..00000000 --- a/_build/cargo-make.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -param ( - [Parameter(Mandatory=$true)][string]$version, - [Parameter(Mandatory=$true)][string]$target -) - -# Location to put cargo-make binary. -$cargobindir = "$env:userprofile\.cargo\bin" - -# Location to stage downloaded zip file. -$zipfile = "$env:temp\cargo-make.zip" - -$url = "https://github.com/sagiegurari/cargo-make/releases/download/${version}/cargo-make-v${version}-${target}.zip" - -# Download the zip file. -Invoke-WebRequest -Uri $url -OutFile $zipfile - -# Extract the binary to the correct location. -Expand-Archive -Path $zipfile -DestinationPath $cargobindir - -# Tell azure pipelines the PATH has changed for future steps. -Write-Host "##vso[task.setvariable variable=PATH;]%PATH%;$cargobindir" diff --git a/_build/cargo-make.sh b/_build/cargo-make.sh deleted file mode 100755 index a93d19dc..00000000 --- a/_build/cargo-make.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -if [ -z ${1+x} ]; -then - echo "Missing version as first argument"; - exit 1 -fi - -if [ -z ${2+x} ]; -then - echo "Missing target as second argument"; - exit 1 -fi - -curl https://github.com/sagiegurari/cargo-make/releases/download/${1}/cargo-make-v${1}-${2}.zip -sSfL -o /tmp/cargo-make.zip; -unzip /tmp/cargo-make.zip; -mkdir -p "$HOME/.cargo/bin"; -mv cargo-make-*/* $HOME/.cargo/bin; -echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" diff --git a/_build/release.toml b/_build/release.toml deleted file mode 100644 index b0acba60..00000000 --- a/_build/release.toml +++ /dev/null @@ -1,6 +0,0 @@ -pre-release-commit-message = "Release {{crate_name}} {{version}}" -post-release-commit-message = "Bump {{crate_name}} version to {{next_version}}" -tag-message = "Release {{crate_name}} {{version}}" -pre-release-replacements = [ - {file="CHANGELOG.md", min=0, search="# master", replace="# master\n\n- Compatibility with the latest `juniper`.\n\n# [[{{version}}] {{date}}](https://github.com/graphql-rust/juniper/releases/tag/{{crate_name}}-{{version}})"}, -] diff --git a/_build/travis-juniper.enc b/_build/travis-juniper.enc deleted file mode 100644 index c0c769ae..00000000 --- a/_build/travis-juniper.enc +++ /dev/null @@ -1 +0,0 @@ -´LÅØAtÙèù˜Û‡uÙË}k¦b÷Œ«iíãxN»ÔJÛb'OÅ’€6°¤ê·Äs–Þ`(¯vZeòaˆ°Î`ëPÝ‚W[DæW4¾®€Ïe¡·» «ï9¥¿4 ÀÖžgF÷‘ûa¸P‚ýŒ5ò õ/8FQܪ"Bß ~þBrº’¢Ž8@)†Ê0 yeÍĆ»·–²Š àCù·»º´F¹"m§±òö¡wûÑ?INŽTŠ(tõlß•SÀ%K_3ð¾2ò–§^Š^kMLMTJÛÕ½¾Z7cÁüzÖ&qÆsd²H‚¢^¨•‡ \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index d3dd337d..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,109 +0,0 @@ -jobs: - ################################################### - # Formatting - ################################################### - - - job: check_formatting - displayName: Check formatting - pool: - vmImage: 'ubuntu-latest' - steps: - - script: | - export CARGO_HOME="$HOME/.cargo" - curl https://sh.rustup.rs -sSf | sh -s -- -y - $HOME/.cargo/bin/rustup component add rustfmt - displayName: Install stable Rust - - script: | - $HOME/.cargo/bin/cargo fmt -- --check - displayName: Run rustfmt - - ################################################### - # Book - ################################################### - - - job: run_book_tests - displayName: Book code example tests - pool: - vmImage: 'ubuntu-latest' - steps: - - script: | - export CARGO_HOME="$HOME/.cargo" - curl https://sh.rustup.rs -sSf | sh -s -- -y - $HOME/.cargo/bin/rustup component add rustfmt - displayName: Install stable Rust - - script: | - cd docs/book/tests && $HOME/.cargo/bin/cargo test - displayName: Test book code examples via skeptic - - - job: build_book_master - displayName: Build rendered book on master branch and push to Github - pool: - vmImage: 'ubuntu-latest' - dependsOn: run_book_tests - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) - variables: - - group: github-keys - steps: - - task: InstallSSHKey@0 - inputs: - hostName: $(GHSshKnownHosts) - sshPublicKey: $(GHSshPub) - sshKeySecureFile: $(GHSshPriv) - - script: | - ./docs/book/ci-build.sh master - - ################################################### - # Main Builds - ################################################### - - - template: _build/azure-pipelines-template.yml - parameters: - name: Linux - vmImage: 'ubuntu-latest' - - - template: _build/azure-pipelines-template.yml - parameters: - name: macOS - vmImage: 'macOS-latest' - - - template: _build/azure-pipelines-template.yml - parameters: - name: Windows - vmImage: 'windows-latest' - - ################################################### - # Releases - ################################################### - - #- job: check_release_automation - # displayName: Check release automation - # pool: - # vmImage: 'ubuntu-latest' - # steps: - # - script: | - # export CARGO_HOME="$HOME/.cargo" - # curl https://sh.rustup.rs -sSf | sh -s -- -y - # echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" - # displayName: Install stable Rust - # - script: | - # _build/cargo-make.sh "0.20.0" "x86_64-unknown-linux-musl" - # displayName: Install cargo-make binary - # - script: | - # cargo install --debug --version=0.19.4 cargo-release - # displayName: Install cargo-release binary - # - script: | - # git config --local user.name "Release Test Bot" - # git config --local user.email "juniper@example.com" - # displayName: Set up git - # - script: | - # RELEASE_LEVEL="minor" cargo make release-dry-run - # displayName: Dry run mode - # - script: | - # RELEASE_LEVEL="minor" cargo make release-local-test - # displayName: Local test mode - # - script: | - # git --no-pager log -p HEAD...HEAD~20 - # # NOTE: this is rolled into one task due to onerous - # # "bash not found" error on Azure. - # cargo make workspace-ci-flow --no-workspace - # displayName: Echo local changes && make sure build and tests still work diff --git a/juniper_benchmarks/Cargo.toml b/benches/Cargo.toml similarity index 73% rename from juniper_benchmarks/Cargo.toml rename to benches/Cargo.toml index d2f49993..c5014f5a 100644 --- a/juniper_benchmarks/Cargo.toml +++ b/benches/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "juniper_benchmarks" -version = "0.1.0" +version = "0.0.0" edition = "2018" authors = ["Christoph Herzog "] +publish = false [dependencies] futures = "0.3" @@ -10,7 +11,7 @@ juniper = { path = "../juniper" } [dev-dependencies] criterion = "0.3" -tokio = { version = "1", features = ["rt-multi-thread"] } +tokio = { version = "1.0", features = ["rt-multi-thread"] } [[bench]] name = "benchmark" diff --git a/juniper_benchmarks/benches/benchmark.rs b/benches/benches/benchmark.rs similarity index 100% rename from juniper_benchmarks/benches/benchmark.rs rename to benches/benches/benchmark.rs diff --git a/juniper_benchmarks/src/lib.rs b/benches/src/lib.rs similarity index 100% rename from juniper_benchmarks/src/lib.rs rename to benches/src/lib.rs diff --git a/book/.gitignore b/book/.gitignore new file mode 100644 index 00000000..130662c4 --- /dev/null +++ b/book/.gitignore @@ -0,0 +1,2 @@ +/_rendered/ +/gh-pages/ diff --git a/book/README.md b/book/README.md new file mode 100644 index 00000000..f4b28d98 --- /dev/null +++ b/book/README.md @@ -0,0 +1,67 @@ +Juniper Book +============ + +Book containing the [`juniper`](https://docs.rs/juniper) user guide. + + + + +## Contributing + + +### Requirements + +The Book is built with [mdBook](https://github.com/rust-lang/mdBook). + +You may install it with: +```bash +cargo install mdbook +``` + + +### Local test server + +To launch a local test server that continually re-builds the Book and auto-reloads the page, run: +```bash +mdbook serve + +# or from project root dir: +make book.serve +``` + + +### Building + +You may build the Book to rendered HTML with this command: +```bash +mdbook build + +# or from project root dir: +make book +``` + +The output will be in the `_rendered/` directory. + + +### Testing + +To run the tests validating all code examples in the book, run: +```bash +cd tests/ +cargo test + +# or from project root dir: +cargo test -p juniper_book_tests + +# or via shortcut from project root dir: +make test.book +``` + + + + +## Test setup + +All Rust code examples in the book are compiled on the CI. + +This is done using the [skeptic](https://github.com/budziq/rust-skeptic) crate. diff --git a/book/book.toml b/book/book.toml new file mode 100644 index 00000000..9fc67124 --- /dev/null +++ b/book/book.toml @@ -0,0 +1,16 @@ +[book] +title = "Juniper Book (GraphQL server for Rust)" +description = "User guide for Juniper (GraphQL server library for Rust)." +language = "en" +multilingual = false +src = "src" + +[build] +build-dir = "_rendered" +create-missing = false + +[output.html] +git_repository_url = "https://github.com/graphql-rs/juniper" + +[rust] +edition = "2018" diff --git a/docs/book/content/README.md b/book/src/README.md similarity index 100% rename from docs/book/content/README.md rename to book/src/README.md diff --git a/docs/book/content/SUMMARY.md b/book/src/SUMMARY.md similarity index 100% rename from docs/book/content/SUMMARY.md rename to book/src/SUMMARY.md diff --git a/docs/book/content/advanced/dataloaders.md b/book/src/advanced/dataloaders.md similarity index 98% rename from docs/book/content/advanced/dataloaders.md rename to book/src/advanced/dataloaders.md index fe172d1d..560f6048 100644 --- a/docs/book/content/advanced/dataloaders.md +++ b/book/src/advanced/dataloaders.md @@ -50,12 +50,12 @@ DataLoader caching does not replace Redis, Memcache, or any other shared applica [dependencies] actix-identity = "0.4.0-beta.4" actix-rt = "1.0" -actix-web = {version = "2.0", features = []} -juniper = { git = "https://github.com/graphql-rust/juniper" } -futures = "0.3" -postgres = "0.15.2" -dataloader = "0.12.0" +actix-web = "2.0" async-trait = "0.1.30" +dataloader = "0.12.0" +futures = "0.3" +juniper = "0.16.0" +postgres = "0.15.2" ``` ```rust, ignore diff --git a/docs/book/content/advanced/implicit_and_explicit_null.md b/book/src/advanced/implicit_and_explicit_null.md similarity index 100% rename from docs/book/content/advanced/implicit_and_explicit_null.md rename to book/src/advanced/implicit_and_explicit_null.md diff --git a/docs/book/content/advanced/index.md b/book/src/advanced/index.md similarity index 100% rename from docs/book/content/advanced/index.md rename to book/src/advanced/index.md diff --git a/docs/book/content/advanced/introspection.md b/book/src/advanced/introspection.md similarity index 100% rename from docs/book/content/advanced/introspection.md rename to book/src/advanced/introspection.md diff --git a/docs/book/content/advanced/multiple_ops_per_request.md b/book/src/advanced/multiple_ops_per_request.md similarity index 100% rename from docs/book/content/advanced/multiple_ops_per_request.md rename to book/src/advanced/multiple_ops_per_request.md diff --git a/docs/book/content/advanced/non_struct_objects.md b/book/src/advanced/non_struct_objects.md similarity index 100% rename from docs/book/content/advanced/non_struct_objects.md rename to book/src/advanced/non_struct_objects.md diff --git a/docs/book/content/advanced/objects_and_generics.md b/book/src/advanced/objects_and_generics.md similarity index 100% rename from docs/book/content/advanced/objects_and_generics.md rename to book/src/advanced/objects_and_generics.md diff --git a/docs/book/content/advanced/subscriptions.md b/book/src/advanced/subscriptions.md similarity index 97% rename from docs/book/content/advanced/subscriptions.md rename to book/src/advanced/subscriptions.md index 05e01d64..90877c42 100644 --- a/docs/book/content/advanced/subscriptions.md +++ b/book/src/advanced/subscriptions.md @@ -12,8 +12,8 @@ be returned to the end user. The [`juniper_subscriptions`][juniper_subscriptions provides a default connection implementation. Currently subscriptions are only supported on the `master` branch. Add the following to your `Cargo.toml`: ```toml [dependencies] -juniper = { git = "https://github.com/graphql-rust/juniper", branch = "master" } -juniper_subscriptions = { git = "https://github.com/graphql-rust/juniper", branch = "master" } +juniper = "0.16.0" +juniper_subscriptions = "0.17.0" ``` ### Schema Definition diff --git a/docs/book/content/quickstart.md b/book/src/quickstart.md similarity index 99% rename from docs/book/content/quickstart.md rename to book/src/quickstart.md index 1fbcd882..b8ff7226 100644 --- a/docs/book/content/quickstart.md +++ b/book/src/quickstart.md @@ -8,7 +8,7 @@ Juniper follows a [code-first approach][schema_approach] to defining GraphQL sch ```toml [dependencies] -juniper = "0.15" +juniper = "0.16.0" ``` ## Schema example diff --git a/docs/book/content/schema/schemas_and_mutations.md b/book/src/schema/schemas_and_mutations.md similarity index 99% rename from docs/book/content/schema/schemas_and_mutations.md rename to book/src/schema/schemas_and_mutations.md index c7ecc7d3..2502f83d 100644 --- a/docs/book/content/schema/schemas_and_mutations.md +++ b/book/src/schema/schemas_and_mutations.md @@ -101,6 +101,7 @@ schema { query: Query } "; +# #[cfg(not(target_os = "windows"))] assert_eq!(result, expected); } ``` diff --git a/docs/book/content/servers/hyper.md b/book/src/servers/hyper.md similarity index 95% rename from docs/book/content/servers/hyper.md rename to book/src/servers/hyper.md index a9c0c7b8..f53f25c8 100644 --- a/docs/book/content/servers/hyper.md +++ b/book/src/servers/hyper.md @@ -16,8 +16,8 @@ Juniper's Hyper integration is contained in the [`juniper_hyper`][juniper_hyper] ```toml [dependencies] -juniper = "0.15.7" -juniper_hyper = "0.8.0" +juniper = "0.16.0" +juniper_hyper = "0.9.0" ``` Included in the source is a [small example][example] which sets up a basic GraphQL and [GraphiQL] handler. diff --git a/docs/book/content/servers/index.md b/book/src/servers/index.md similarity index 100% rename from docs/book/content/servers/index.md rename to book/src/servers/index.md diff --git a/docs/book/content/servers/iron.md b/book/src/servers/iron.md similarity index 98% rename from docs/book/content/servers/iron.md rename to book/src/servers/iron.md index 7fd92e83..9c81fc4b 100644 --- a/docs/book/content/servers/iron.md +++ b/book/src/servers/iron.md @@ -11,8 +11,8 @@ Juniper's Iron integration is contained in the `juniper_iron` crate: ```toml [dependencies] -juniper = "0.15.7" -juniper_iron = "0.7.4" +juniper = "0.16.0" +juniper_iron = "0.8.0" ``` Included in the source is a [small diff --git a/docs/book/content/servers/official.md b/book/src/servers/official.md similarity index 100% rename from docs/book/content/servers/official.md rename to book/src/servers/official.md diff --git a/docs/book/content/servers/rocket.md b/book/src/servers/rocket.md similarity index 94% rename from docs/book/content/servers/rocket.md rename to book/src/servers/rocket.md index 320e3d90..bf976812 100644 --- a/docs/book/content/servers/rocket.md +++ b/book/src/servers/rocket.md @@ -10,8 +10,8 @@ Juniper's Rocket integration is contained in the [`juniper_rocket`][juniper_rock ```toml [dependencies] -juniper = "0.15.7" -juniper_rocket = "0.8.0" +juniper = "0.16.0" +juniper_rocket = "0.9.0" ``` Included in the source is a [small example][example] which sets up a basic GraphQL and [GraphiQL] handler. diff --git a/docs/book/content/servers/third-party.md b/book/src/servers/third-party.md similarity index 100% rename from docs/book/content/servers/third-party.md rename to book/src/servers/third-party.md diff --git a/docs/book/content/servers/warp.md b/book/src/servers/warp.md similarity index 95% rename from docs/book/content/servers/warp.md rename to book/src/servers/warp.md index ef5a3024..1f7338eb 100644 --- a/docs/book/content/servers/warp.md +++ b/book/src/servers/warp.md @@ -10,8 +10,8 @@ Juniper's Warp integration is contained in the [`juniper_warp`][juniper_warp] cr ```toml [dependencies] -juniper = "0.15.7" -juniper_warp = "0.7.0" +juniper = "0.16.0" +juniper_warp = "0.8.0" ``` Included in the source is a [small example][example] which sets up a basic GraphQL and [GraphiQL] handler. diff --git a/docs/book/content/styles/website.css b/book/src/styles/website.css similarity index 100% rename from docs/book/content/styles/website.css rename to book/src/styles/website.css diff --git a/docs/book/content/types/enums.md b/book/src/types/enums.md similarity index 100% rename from docs/book/content/types/enums.md rename to book/src/types/enums.md diff --git a/docs/book/content/types/index.md b/book/src/types/index.md similarity index 100% rename from docs/book/content/types/index.md rename to book/src/types/index.md diff --git a/docs/book/content/types/input_objects.md b/book/src/types/input_objects.md similarity index 100% rename from docs/book/content/types/input_objects.md rename to book/src/types/input_objects.md diff --git a/docs/book/content/types/interfaces.md b/book/src/types/interfaces.md similarity index 100% rename from docs/book/content/types/interfaces.md rename to book/src/types/interfaces.md diff --git a/docs/book/content/types/objects/complex_fields.md b/book/src/types/objects/complex_fields.md similarity index 100% rename from docs/book/content/types/objects/complex_fields.md rename to book/src/types/objects/complex_fields.md diff --git a/docs/book/content/types/objects/defining_objects.md b/book/src/types/objects/defining_objects.md similarity index 100% rename from docs/book/content/types/objects/defining_objects.md rename to book/src/types/objects/defining_objects.md diff --git a/docs/book/content/types/objects/error_handling.md b/book/src/types/objects/error_handling.md similarity index 100% rename from docs/book/content/types/objects/error_handling.md rename to book/src/types/objects/error_handling.md diff --git a/docs/book/content/types/objects/using_contexts.md b/book/src/types/objects/using_contexts.md similarity index 100% rename from docs/book/content/types/objects/using_contexts.md rename to book/src/types/objects/using_contexts.md diff --git a/docs/book/content/types/other-index.md b/book/src/types/other-index.md similarity index 100% rename from docs/book/content/types/other-index.md rename to book/src/types/other-index.md diff --git a/docs/book/content/types/scalars.md b/book/src/types/scalars.md similarity index 100% rename from docs/book/content/types/scalars.md rename to book/src/types/scalars.md diff --git a/docs/book/content/types/unions.md b/book/src/types/unions.md similarity index 100% rename from docs/book/content/types/unions.md rename to book/src/types/unions.md diff --git a/book/tests/Cargo.toml b/book/tests/Cargo.toml new file mode 100644 index 00000000..d027420c --- /dev/null +++ b/book/tests/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "juniper_book_tests" +version = "0.0.0" +edition = "2018" +authors = ["Magnus Hallin "] +publish = false + +[dependencies] +derive_more = "0.99" +futures = "0.3" +iron = "0.5" +juniper = { path = "../../juniper" } +juniper_iron = { path = "../../juniper_iron" } +juniper_subscriptions = { path = "../../juniper_subscriptions" } +mount = "0.4" +serde_json = "1.0" +skeptic = "0.13" +tokio = { version = "1.0", features = ["macros", "rt-multi-thread", "sync"] } +uuid = "0.8" + +[build-dependencies] +skeptic = "0.13" diff --git a/book/tests/build.rs b/book/tests/build.rs new file mode 100644 index 00000000..80e0cbe1 --- /dev/null +++ b/book/tests/build.rs @@ -0,0 +1,4 @@ +fn main() { + let files = skeptic::markdown_files_of_directory("../src/"); + skeptic::generate_doc_tests(&files); +} diff --git a/docs/book/tests/src/lib.rs b/book/tests/src/lib.rs similarity index 100% rename from docs/book/tests/src/lib.rs rename to book/tests/src/lib.rs diff --git a/docs/book/.gitignore b/docs/book/.gitignore deleted file mode 100644 index 04b96921..00000000 --- a/docs/book/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_rendered diff --git a/docs/book/README.md b/docs/book/README.md deleted file mode 100644 index 3c33ac51..00000000 --- a/docs/book/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Juniper Book - -Book containing the Juniper documentation. - -## Contributing - -### Requirements - -The book is built with [mdBook](https://github.com/rust-lang-nursery/mdBook). - -You can install it with: - -```bash -cargo install mdbook -``` - -### Starting a local test server - -To launch a local test server that continually re-builds the book and autoreloads the page, run: - -```bash -mdbook serve -``` - -### Building the book - -You can build the book to rendered HTML with this command: - -```bash -mdbook build -``` - -The output will be in the `./_rendered` directory. - -### Running the tests - -To run the tests validating all code examples in the book, run: - -```bash -cd ./tests -cargo test -``` - -## Test setup - -All Rust code examples in the book are compiled on the CI. - -This is done using the [skeptic](https://github.com/budziq/rust-skeptic) library. diff --git a/docs/book/book.toml b/docs/book/book.toml deleted file mode 100644 index 242dc1b1..00000000 --- a/docs/book/book.toml +++ /dev/null @@ -1,11 +0,0 @@ -[book] -title = "Juniper - GraphQL Server for Rust" -description = "Documentation for juniper, a GraphQL server library for Rust." -src = "content" - -[build] -build-dir = "_rendered" -create-missing = false - -[output.html] -git_repository_url = "https://github.com/graphql-rs/juniper" diff --git a/docs/book/ci-build.sh b/docs/book/ci-build.sh deleted file mode 100755 index 3b00bb4e..00000000 --- a/docs/book/ci-build.sh +++ /dev/null @@ -1,52 +0,0 @@ -#! /usr/bin/env bash - -# Usage: ./ci-build.sh VERSION -# -# This script builds the book to HTML with mdbook -# commits and pushes the contents to the repo in the "gh-pages" branch. -# -# It is only inteded for use on the CI! - -# Enable strict error checking. -set -exo pipefail - -DIR=$(dirname $(readlink -f $0)) -MDBOOK="mdbook" - -cd $DIR - -# Verify version argument. - -if [[ -z "$1" ]]; then - echo "Missing required argument 'version': cargo make build-book VERSION" - exit -fi -VERSION="$1" - -# Download mdbook if not found. - -if [ $MDBOOK -h ]; then - echo "mdbook found..." -else - echo "mdbook not found. Downloading..." - curl -L https://github.com/rust-lang-nursery/mdBook/releases/download/v0.2.0/mdbook-v0.2.0-x86_64-unknown-linux-gnu.tar.gz | tar xzf - - mv ./mdbook /tmp/mdbook - MDBOOK="/tmp/mdbook" -fi - -$MDBOOK build -echo $VERSION > ./_rendered/VERSION -rm -rf /tmp/book-content -mv ./_rendered /tmp/book-content - -cd $DIR/../.. -git clean -fd -git checkout gh-pages -rm -rf $VERSION -mv /tmp/book-content ./$VERSION -git remote set-url --push origin git@github.com:graphql-rust/juniper.git -git config --local user.name "Juniper Bot" -git config --local user.email "juniper@example.com" -git add -A $VERSION -git diff-index --quiet HEAD || git commit -m "Updated book for $VERSION ***NO_CI***" -git push origin gh-pages diff --git a/docs/book/tests/.gitignore b/docs/book/tests/.gitignore deleted file mode 100644 index 6aa10640..00000000 --- a/docs/book/tests/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target/ -**/*.rs.bk -Cargo.lock diff --git a/docs/book/tests/Cargo.toml b/docs/book/tests/Cargo.toml deleted file mode 100644 index c67ebe93..00000000 --- a/docs/book/tests/Cargo.toml +++ /dev/null @@ -1,26 +0,0 @@ -[package] -name = "juniper_book_tests" -version = "0.1.0" -edition = "2018" -authors = ["Magnus Hallin "] -build = "build.rs" - -[dependencies] -juniper = { path = "../../../juniper" } -juniper_iron = { path = "../../../juniper_iron" } -juniper_subscriptions = { path = "../../../juniper_subscriptions" } - -derive_more = "0.99" -futures = "0.3" -iron = "0.5" -mount = "0.4" -skeptic = "0.13" -serde_json = "1.0" -tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync"] } -uuid = "0.8" - -[build-dependencies] -skeptic = "0.13" - -[patch.crates-io] -juniper_codegen = { path = "../../../juniper_codegen" } diff --git a/docs/book/tests/build.rs b/docs/book/tests/build.rs deleted file mode 100644 index 425f644b..00000000 --- a/docs/book/tests/build.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - let files = skeptic::markdown_files_of_directory("../content/"); - skeptic::generate_doc_tests(&files); -} diff --git a/examples/actix_subscriptions/Cargo.toml b/examples/actix_subscriptions/Cargo.toml index cec502e3..9bab7b3b 100644 --- a/examples/actix_subscriptions/Cargo.toml +++ b/examples/actix_subscriptions/Cargo.toml @@ -1,20 +1,20 @@ [package] -name = "actix_subscriptions" -version = "0.1.0" +name = "example_actix_subscriptions" +version = "0.0.0" edition = "2018" authors = ["Mihai Dinculescu "] publish = false [dependencies] -actix-web = "4.0" actix-cors = "0.6" -futures = "0.3" -env_logger = "0.9" -serde = "1.0" -serde_json = "1.0" -rand = "0.8" -tokio = "1.0" +actix-web = "4.0" async-stream = "0.3" +env_logger = "0.9" +futures = "0.3" juniper = { path = "../../juniper", features = ["expose-test-schema"] } juniper_actix = { path = "../../juniper_actix", features = ["subscriptions"] } juniper_graphql_ws = { path = "../../juniper_graphql_ws" } +rand = "0.8" +serde = "1.0" +serde_json = "1.0" +tokio = "1.0" diff --git a/examples/actix_subscriptions/Makefile.toml b/examples/actix_subscriptions/Makefile.toml deleted file mode 100644 index dccba933..00000000 --- a/examples/actix_subscriptions/Makefile.toml +++ /dev/null @@ -1,15 +0,0 @@ -[tasks.run] -disabled = true - -[tasks.release] -disabled = true -[tasks.release-some] -disabled = true -[tasks.release-local-test] -disabled = true -[tasks.release-some-local-test] -disabled = true -[tasks.release-dry-run] -disabled = true -[tasks.release-some-dry-run] -disabled = true diff --git a/examples/basic_subscriptions/.gitignore b/examples/basic_subscriptions/.gitignore deleted file mode 100644 index eb5a316c..00000000 --- a/examples/basic_subscriptions/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/examples/basic_subscriptions/Cargo.toml b/examples/basic_subscriptions/Cargo.toml index 8367cd16..f03bdef4 100644 --- a/examples/basic_subscriptions/Cargo.toml +++ b/examples/basic_subscriptions/Cargo.toml @@ -1,15 +1,14 @@ [package] -name = "basic_subscriptions" -version = "0.1.0" +name = "example_basic_subscriptions" +version = "0.0.0" edition = "2018" -publish = false authors = ["Jordao Rosario "] +publish = false [dependencies] futures = "0.3" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -tokio = { version = "1", features = ["macros", "rt-multi-thread"] } - juniper = { path = "../../juniper" } juniper_subscriptions = { path = "../../juniper_subscriptions" } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } diff --git a/examples/basic_subscriptions/Makefile.toml b/examples/basic_subscriptions/Makefile.toml deleted file mode 100644 index 13dc05ed..00000000 --- a/examples/basic_subscriptions/Makefile.toml +++ /dev/null @@ -1,15 +0,0 @@ -[tasks.run] -disabled = true - -[tasks.release] -disabled = true -[tasks.release-some] -disabled = true -[tasks.release-local-test] -disabled = true -[tasks.release-some-local-test] -disabled = true -[tasks.release-dry-run] -disabled = true -[tasks.release-some-dry-run] -disabled = true \ No newline at end of file diff --git a/examples/warp_async/.gitignore b/examples/warp_async/.gitignore deleted file mode 100644 index eb5a316c..00000000 --- a/examples/warp_async/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/examples/warp_async/Cargo.toml b/examples/warp_async/Cargo.toml index 8c6f70c5..94208317 100644 --- a/examples/warp_async/Cargo.toml +++ b/examples/warp_async/Cargo.toml @@ -1,17 +1,16 @@ [package] -name = "warp_async" -version = "0.1.0" +name = "example_warp_async" +version = "0.0.0" edition = "2018" -publish = false authors = ["Christoph Herzog "] +publish = false [dependencies] +env_logger = "0.9" +futures = "0.3" juniper = { path = "../../juniper" } juniper_warp = { path = "../../juniper_warp" } - -env_logger = "0.9" -futures = "0.3.1" -log = "0.4.8" +log = "0.4" reqwest = { version = "0.11", features = ["rustls-tls"] } -tokio = { version = "1", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } warp = "0.3" diff --git a/examples/warp_async/Makefile.toml b/examples/warp_async/Makefile.toml deleted file mode 100644 index 13dc05ed..00000000 --- a/examples/warp_async/Makefile.toml +++ /dev/null @@ -1,15 +0,0 @@ -[tasks.run] -disabled = true - -[tasks.release] -disabled = true -[tasks.release-some] -disabled = true -[tasks.release-local-test] -disabled = true -[tasks.release-some-local-test] -disabled = true -[tasks.release-dry-run] -disabled = true -[tasks.release-some-dry-run] -disabled = true \ No newline at end of file diff --git a/examples/warp_subscriptions/.gitignore b/examples/warp_subscriptions/.gitignore deleted file mode 100644 index eb5a316c..00000000 --- a/examples/warp_subscriptions/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/examples/warp_subscriptions/Cargo.toml b/examples/warp_subscriptions/Cargo.toml index 4c0b0025..6e22c5a7 100644 --- a/examples/warp_subscriptions/Cargo.toml +++ b/examples/warp_subscriptions/Cargo.toml @@ -1,19 +1,18 @@ [package] -name = "warp_subscriptions" -version = "0.1.0" +name = "example_warp_subscriptions" +version = "0.0.0" edition = "2018" publish = false [dependencies] +async-stream = "0.3" env_logger = "0.9" futures = "0.3.1" -log = "0.4.8" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -tokio = { version = "1", features = ["macros", "rt-multi-thread"] } -warp = "0.3" -async-stream = "0.3" - juniper = { path = "../../juniper" } juniper_graphql_ws = { path = "../../juniper_graphql_ws" } juniper_warp = { path = "../../juniper_warp", features = ["subscriptions"] } +log = "0.4.8" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } +warp = "0.3" diff --git a/examples/warp_subscriptions/Makefile.toml b/examples/warp_subscriptions/Makefile.toml deleted file mode 100644 index 13dc05ed..00000000 --- a/examples/warp_subscriptions/Makefile.toml +++ /dev/null @@ -1,15 +0,0 @@ -[tasks.run] -disabled = true - -[tasks.release] -disabled = true -[tasks.release-some] -disabled = true -[tasks.release-local-test] -disabled = true -[tasks.release-some-local-test] -disabled = true -[tasks.release-dry-run] -disabled = true -[tasks.release-some-dry-run] -disabled = true \ No newline at end of file diff --git a/integration_tests/async_await/Cargo.toml b/integration_tests/async_await/Cargo.toml deleted file mode 100644 index b625a33f..00000000 --- a/integration_tests/async_await/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "async_await" -version = "0.1.0" -edition = "2018" -authors = ["Christoph Herzog "] -publish = false - -[dependencies] -juniper = { path = "../../juniper" } -futures = "0.3.1" -tokio = { version = "1", features = ["rt", "time", "macros"] } \ No newline at end of file diff --git a/integration_tests/async_await/src/main.rs b/integration_tests/async_await/src/main.rs deleted file mode 100644 index 2b913a7e..00000000 --- a/integration_tests/async_await/src/main.rs +++ /dev/null @@ -1,167 +0,0 @@ -use juniper::{graphql_object, GraphQLEnum}; - -#[derive(GraphQLEnum)] -enum UserKind { - Admin, - User, - Guest, -} - -struct User { - #[allow(dead_code)] - id: i32, - name: String, - kind: UserKind, -} - -#[graphql_object] -impl User { - async fn id(&self) -> i32 { - self.id - } - - async fn name(&self) -> &str { - &self.name - } - - async fn friends(&self) -> Vec { - (0..10) - .map(|index| User { - id: index, - name: format!("user{}", index), - kind: UserKind::User, - }) - .collect() - } - - async fn kind(&self) -> &UserKind { - &self.kind - } - - async fn delayed() -> bool { - tokio::time::sleep(std::time::Duration::from_millis(100)).await; - true - } -} - -struct Query; - -#[graphql_object] -impl Query { - fn field_sync(&self) -> &'static str { - "field_sync" - } - - async fn field_async_plain() -> String { - "field_async_plain".to_string() - } - - fn user(id: String) -> User { - User { - id: 1, - name: id, - kind: UserKind::User, - } - } - - async fn delayed() -> bool { - tokio::time::sleep(std::time::Duration::from_millis(100)).await; - true - } -} - -fn main() {} - -#[cfg(test)] -mod tests { - use juniper::{graphql_value, EmptyMutation, EmptySubscription, GraphQLError, RootNode, Value}; - - use super::Query; - - #[tokio::test] - async fn async_simple() { - let schema = RootNode::new(Query, EmptyMutation::new(), EmptySubscription::new()); - let doc = r#"query { - fieldSync - fieldAsyncPlain - delayed - user(id: "user1") { - kind - name - delayed - } - }"#; - - let vars = Default::default(); - let (res, errs) = juniper::execute(doc, None, &schema, &vars, &()) - .await - .unwrap(); - - assert!(errs.is_empty()); - - let obj = res.into_object().unwrap(); - let value = Value::Object(obj); - - assert_eq!( - value, - graphql_value!({ - "delayed": true, - "fieldAsyncPlain": "field_async_plain", - "fieldSync": "field_sync", - "user": { - "delayed": true, - "kind": "USER", - "name": "user1", - }, - }), - ); - } - - #[tokio::test] - async fn async_field_validation_error() { - let schema = RootNode::new(Query, EmptyMutation::new(), EmptySubscription::new()); - let doc = r#"query { - nonExistentField - fieldSync - fieldAsyncPlain - delayed - user(id: "user1") { - kind - name - delayed - } - }"#; - - let vars = Default::default(); - let result = juniper::execute(doc, None, &schema, &vars, &()).await; - assert!(result.is_err()); - - let error = result.err().unwrap(); - let is_validation_error = match error { - GraphQLError::ValidationError(_) => true, - _ => false, - }; - assert!(is_validation_error); - } - - // FIXME: test seems broken by design, re-enable later - // #[tokio::test] - // async fn resolve_into_stream_validation_error() { - // let schema = RootNode::new(Query, EmptyMutation::new(), EmptySubscription::new()); - // let doc = r#" - // subscription { - // nonExistent - // } - // "#; - // let vars = Default::default(); - // let result = juniper::resolve_into_stream(doc, None, &schema, &vars, &()).await; - // assert!(result.is_err()); - - // let error = result.err().unwrap(); - // let is_validation_error = match error { - // GraphQLError::ValidationError(_) => true, - // _ => false, - // }; - // assert!(is_validation_error); - // } -} diff --git a/integration_tests/codegen_fail/Makefile.toml b/integration_tests/codegen_fail/Makefile.toml deleted file mode 100644 index 23316355..00000000 --- a/integration_tests/codegen_fail/Makefile.toml +++ /dev/null @@ -1,29 +0,0 @@ -[tasks.release] -disabled = true -[tasks.release-some] -disabled = true -[tasks.release-local-test] -disabled = true -[tasks.release-some-local-test] -disabled = true -[tasks.release-dry-run] -disabled = true -[tasks.release-some-dry-run] -disabled = true - -[tasks.test] -condition = { channels = ["nightly"] } -[tasks.test-custom] -condition = { channels = ["nightly"] } -[tasks.test-flow] -condition = { channels = ["nightly"] } -[tasks.test-multi-flow-phase] -condition = { channels = ["nightly"] } -[tasks.test-thread-safe] -condition = { channels = ["nightly"] } -[tasks.test-verbose] -condition = { channels = ["nightly"] } -[tasks.test-with-args] -condition = { channels = ["nightly"] } -[tasks.ci-coverage-flow] -condition = { channels = ["nightly"] } \ No newline at end of file diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_additional_non_nullable_argument.stderr b/integration_tests/codegen_fail/fail/interface/struct/attr_additional_non_nullable_argument.stderr deleted file mode 100644 index 60a8f73c..00000000 --- a/integration_tests/codegen_fail/fail/interface/struct/attr_additional_non_nullable_argument.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/struct/attr_additional_non_nullable_argument.rs:16:5 - | -16 | id: String, - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/struct/attr_additional_non_nullable_argument.rs:16:5 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/interface/struct/attr_field_non_output_return_type.stderr deleted file mode 100644 index ecd251f1..00000000 --- a/integration_tests/codegen_fail/fail/interface/struct/attr_field_non_output_return_type.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/interface/struct/attr_field_non_output_return_type.rs:10:9 - | -10 | id: ObjB, - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_missing_field.stderr b/integration_tests/codegen_fail/fail/interface/struct/attr_missing_field.stderr deleted file mode 100644 index 47856d5d..00000000 --- a/integration_tests/codegen_fail/fail/interface/struct/attr_missing_field.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/struct/attr_missing_field.rs:11:5 - | -11 | id: String, - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/attr_missing_field.rs:11:5 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_non_subtype_return.stderr b/integration_tests/codegen_fail/fail/interface/struct/attr_non_subtype_return.stderr deleted file mode 100644 index 213ecb20..00000000 --- a/integration_tests/codegen_fail/fail/interface/struct/attr_non_subtype_return.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/struct/attr_non_subtype_return.rs:11:5 - | -11 | id: String, - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/struct/attr_non_subtype_return.rs:11:5 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_additional_non_nullable_argument.stderr b/integration_tests/codegen_fail/fail/interface/struct/derive_additional_non_nullable_argument.stderr deleted file mode 100644 index cfe81a29..00000000 --- a/integration_tests/codegen_fail/fail/interface/struct/derive_additional_non_nullable_argument.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/struct/derive_additional_non_nullable_argument.rs:17:5 - | -17 | id: String, - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/struct/derive_additional_non_nullable_argument.rs:17:5 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/interface/struct/derive_field_non_output_return_type.stderr deleted file mode 100644 index fc418f48..00000000 --- a/integration_tests/codegen_fail/fail/interface/struct/derive_field_non_output_return_type.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/interface/struct/derive_field_non_output_return_type.rs:10:9 - | -10 | id: ObjB, - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_missing_field.stderr b/integration_tests/codegen_fail/fail/interface/struct/derive_missing_field.stderr deleted file mode 100644 index a8570a6c..00000000 --- a/integration_tests/codegen_fail/fail/interface/struct/derive_missing_field.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/struct/derive_missing_field.rs:12:5 - | -12 | id: String, - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/derive_missing_field.rs:12:5 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_non_subtype_return.stderr b/integration_tests/codegen_fail/fail/interface/struct/derive_non_subtype_return.stderr deleted file mode 100644 index 46c9de9d..00000000 --- a/integration_tests/codegen_fail/fail/interface/struct/derive_non_subtype_return.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/struct/derive_non_subtype_return.rs:12:5 - | -12 | id: String, - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/struct/derive_non_subtype_return.rs:12:5 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/additional_non_nullable_argument.stderr b/integration_tests/codegen_fail/fail/interface/trait/additional_non_nullable_argument.stderr deleted file mode 100644 index f513ef68..00000000 --- a/integration_tests/codegen_fail/fail/interface/trait/additional_non_nullable_argument.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/trait/additional_non_nullable_argument.rs:16:8 - | -16 | fn id(&self) -> &str; - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/trait/additional_non_nullable_argument.rs:16:8 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/interface/trait/field_non_output_return_type.stderr deleted file mode 100644 index 2c6cf3a9..00000000 --- a/integration_tests/codegen_fail/fail/interface/trait/field_non_output_return_type.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/interface/trait/field_non_output_return_type.rs:10:21 - | -10 | fn id(&self) -> ObjB; - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` diff --git a/integration_tests/codegen_fail/fail/interface/trait/missing_field.stderr b/integration_tests/codegen_fail/fail/interface/trait/missing_field.stderr deleted file mode 100644 index d76c39ff..00000000 --- a/integration_tests/codegen_fail/fail/interface/trait/missing_field.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/trait/missing_field.rs:11:8 - | -11 | fn id(&self) -> &str; - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/trait/missing_field.rs:11:8 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/missing_field_argument.stderr b/integration_tests/codegen_fail/fail/interface/trait/missing_field_argument.stderr deleted file mode 100644 index 60ead166..00000000 --- a/integration_tests/codegen_fail/fail/interface/trait/missing_field_argument.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/trait/missing_field_argument.rs:16:8 - | -16 | fn id(&self, is_present: bool) -> &str; - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` was expected, but not found.', $DIR/fail/interface/trait/missing_field_argument.rs:16:8 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/non_subtype_return.stderr b/integration_tests/codegen_fail/fail/interface/trait/non_subtype_return.stderr deleted file mode 100644 index ceefffb7..00000000 --- a/integration_tests/codegen_fail/fail/interface/trait/non_subtype_return.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/trait/non_subtype_return.rs:11:8 - | -11 | fn id(&self) -> &str; - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/trait/non_subtype_return.rs:11:8 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/wrong_argument_type.stderr b/integration_tests/codegen_fail/fail/interface/trait/wrong_argument_type.stderr deleted file mode 100644 index 2921f253..00000000 --- a/integration_tests/codegen_fail/fail/interface/trait/wrong_argument_type.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> fail/interface/trait/wrong_argument_type.rs:16:8 - | -16 | fn id(&self, is_present: bool) -> &str; - | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent`: expected type `Boolean!`, found: `Int!`.', $DIR/fail/interface/trait/wrong_argument_type.rs:16:8 - | - = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/argument_non_input_type.stderr b/integration_tests/codegen_fail/fail/object/argument_non_input_type.stderr deleted file mode 100644 index d4a3b19a..00000000 --- a/integration_tests/codegen_fail/fail/object/argument_non_input_type.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied - --> fail/object/argument_non_input_type.rs:12:23 - | -12 | fn id(&self, obj: ObjA) -> &str { - | ^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` - -error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied - --> fail/object/argument_non_input_type.rs:10:1 - | -10 | #[graphql_object] - | ^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` - | -note: required by a bound in `Registry::<'r, S>::arg` - --> $WORKSPACE/juniper/src/executor/mod.rs - | - | T: GraphQLType + FromInputValue, - | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` - = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied - --> fail/object/argument_non_input_type.rs:10:1 - | -10 | #[graphql_object] - | ^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` - | - = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.stderr deleted file mode 100644 index 56c9587b..00000000 --- a/integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/object/attr_field_non_output_return_type.rs:12:21 - | -12 | fn id(&self) -> ObjB { - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` diff --git a/integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.stderr deleted file mode 100644 index 90a9be58..00000000 --- a/integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/object/derive_field_non_output_return_type.rs:10:9 - | -10 | id: ObjB, - | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` diff --git a/integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.stderr b/integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.stderr deleted file mode 100644 index ed30b222..00000000 --- a/integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied - --> fail/subscription/field_non_output_return_type.rs:17:27 - | -17 | async fn id(&self) -> Stream<'static, ObjB> { - | ^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` diff --git a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr deleted file mode 100644 index f0f17fbc..00000000 --- a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/enum_non_object_variant.rs:9:10 - | -9 | #[derive(GraphQLUnion)] - | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | - = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr deleted file mode 100644 index 57ed7c4c..00000000 --- a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/struct_non_object_variant.rs:9:10 - | -9 | #[derive(GraphQLUnion)] - | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | - = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr deleted file mode 100644 index 092bf452..00000000 --- a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied - --> fail/union/trait_non_object_variant.rs:9:1 - | -9 | #[graphql_union] - | ^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` - | - = note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/juniper_tests/Makefile.toml b/integration_tests/juniper_tests/Makefile.toml deleted file mode 100644 index c1f8c331..00000000 --- a/integration_tests/juniper_tests/Makefile.toml +++ /dev/null @@ -1,12 +0,0 @@ -[tasks.release] -disabled = true -[tasks.release-some] -disabled = true -[tasks.release-local-test] -disabled = true -[tasks.release-some-local-test] -disabled = true -[tasks.release-dry-run] -disabled = true -[tasks.release-some-dry-run] -disabled = true diff --git a/juniper/CHANGELOG.md b/juniper/CHANGELOG.md index e8604ddf..60036119 100644 --- a/juniper/CHANGELOG.md +++ b/juniper/CHANGELOG.md @@ -1,906 +1,110 @@ -# master - -## Security - -- Fix panic on malformed queries with recursive fragments. *This is a potential denial-of-service attack vector.* Thanks to [@quapka](https://github.com/quapka) for the detailed vulnerability report and reproduction steps. - -## Breaking Changes - -- Replaced `Visitor` associated type with `DeserializeOwned` requirement in `ScalarValue` trait. ([#985](https://github.com/graphql-rust/juniper/pull/985)) -- Removed `Serialize` implementation from `#[derive(GraphQLScalarValue)]`macro, now should be provided explicitly. ([#985](https://github.com/graphql-rust/juniper/pull/985)) -- `#[graphql_object]` and `#[graphql_subscription]` macros expansion now preserves defined `impl` blocks "as is" and reuses defined methods in opaque way. ([#971](https://github.com/graphql-rust/juniper/pull/971)) -- `rename = ""` attribute's argument renamed to `rename_all = ""`. ([#971](https://github.com/graphql-rust/juniper/pull/971)) -- Upgrade `bson` feature to [2.0 version of its crate](https://github.com/mongodb/bson-rust/releases/tag/v2.0.0). ([#979](https://github.com/graphql-rust/juniper/pull/979)) -- Make `FromInputValue` methods fallible to allow post-validation. ([#987](https://github.com/graphql-rust/juniper/pull/987)) -- Change `Option` to `Result` in `from_input_value()` return type of `#[graphql_scalar]` macro. ([#987](https://github.com/graphql-rust/juniper/pull/987)) -- Forbid `__typename` field on `subscription` operations [accordingly to October 2021 spec](https://spec.graphql.org/October2021/#note-bc213). ([#1001](https://github.com/graphql-rust/juniper/pull/1001), [#1000](https://github.com/graphql-rust/juniper/pull/1000)) -- Redesign `#[graphql_interface]` macro: ([#1009](https://github.com/graphql-rust/juniper/pull/1009)) - - Remove support for `#[graphql_interface(dyn)]` (interface values as trait objects). - - Remove support for `downcast` (custom resolution into implementer types). - - Remove support for `async` trait methods (not required anymore). - - Remove necessity of writing `impl Trait for Type` blocks (interfaces are implemented just by matching its fields). - - Forbid default impls on non-ignored trait methods. - - Support coercion of additional nullable arguments and return sub-typing on implementer. -- Redesign `#[derive(GraphQLScalar)]` macro: ([#1017](https://github.com/graphql-rust/juniper/pull/1017)) - - Support generic scalars. - - Support structs with single named field. - - Support overriding resolvers. -- Redesign `#[graphql_scalar]` macro: ([#1014](https://github.com/graphql-rust/juniper/pull/1014)) - - Mirror `#[derive(GraphQLScalar)]` macro. - - Support usage on type aliases in case `#[derive(GraphQLScalar)]` isn't applicable because of [orphan rules](https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules). -- Rename `ScalarValue::as_boolean` to `ScalarValue::as_bool`. ([#1025](https://github.com/graphql-rust/juniper/pull/1025)) -- Change [`chrono` crate](https://docs.rs/chrono) GraphQL scalars according to the [graphql-scalars.dev](https://graphql-scalars.dev). ([#1010](https://github.com/graphql-rust/juniper/pull/1010)) -- Disable `chrono` feature by default. ([#1010](https://github.com/graphql-rust/juniper/pull/1010)) -- Remove `scalar-naivetime` feature. ([#1010](https://github.com/graphql-rust/juniper/pull/1010)) - -## Features - -- Support using Rust array as GraphQL list. ([#966](https://github.com/graphql-rust/juniper/pull/966), [#918](https://github.com/graphql-rust/juniper/issues/918)) -- Expose `GraphQLRequest` fields. ([#750](https://github.com/graphql-rust/juniper/issues/750)) -- `#[graphql_interface]` macro now supports `rename_all = ""` argument influencing its fields and their arguments. ([#971](https://github.com/graphql-rust/juniper/pull/971)) -- Use `null` in addition to `None` to create `Value::Null` in `graphql_value!` macro to mirror `serde_json::json!`. ([#996](https://github.com/graphql-rust/juniper/pull/996)) -- Add `From` impls to `InputValue` mirroring the ones for `Value` and provide better support for `Option` handling. ([#996](https://github.com/graphql-rust/juniper/pull/996)) -- Implement `graphql_input_value!` and `graphql_vars!` macros. ([#996](https://github.com/graphql-rust/juniper/pull/996)) -- Support [`time` crate](https://docs.rs/time) types as GraphQL scalars behind `time` feature. ([#1006](https://github.com/graphql-rust/juniper/pull/1006)) -- Add `specified_by_url` attribute argument to `#[derive(GraphQLScalarValue)]` and `#[graphql_scalar]` macros. ([#1003](https://github.com/graphql-rust/juniper/pull/1003), [#1000](https://github.com/graphql-rust/juniper/pull/1000)) -- Support `isRepeatable` field on directives. ([#1003](https://github.com/graphql-rust/juniper/pull/1003), [#1000](https://github.com/graphql-rust/juniper/pull/1000)) -- Support `__Schema.description`, `__Type.specifiedByURL` and `__Directive.isRepeatable` fields in introspection. ([#1003](https://github.com/graphql-rust/juniper/pull/1003), [#1000](https://github.com/graphql-rust/juniper/pull/1000)) -- Support directives on variables definitions. ([#1005](https://github.com/graphql-rust/juniper/pull/1005)) -- Implement `#[derive(ScalarValue)]` macro to derive `ScalarValue` on enums. ([#1025](https://github.com/graphql-rust/juniper/pull/1025)) -- Implement `#[derive(GraphQLInterface)]` macro to use structs as GraphQL interfaces. ([#1026](https://github.com/graphql-rust/juniper/pull/1026)) - -## Fixes - -- Allow spreading interface fragments on unions and other interfaces. ([#965](https://github.com/graphql-rust/juniper/pull/965), [#798](https://github.com/graphql-rust/juniper/issues/798)) -- Support expressions in `graphql_value!` macro. ([#996](https://github.com/graphql-rust/juniper/pull/996), [#503](https://github.com/graphql-rust/juniper/issues/503)) -- List coercion rules: `null` cannot be coerced to an `[Int!]!` or `[Int]!`. ([#1004](https://github.com/graphql-rust/juniper/pull/1004)) - -# [[0.15.9] 2022-02-02](https://github.com/graphql-rust/juniper/releases/tag/juniper-v0.15.9) - -- Fix infinite recursion on malformed queries with nested recursive fragments. *This is a potential denial-of-service attack vector.* Thanks to [@quapka](https://github.com/quapka) for the detailed vulnerability report and reproduction steps. - -# [[0.15.8] 2022-01-26](https://github.com/graphql-rust/juniper/releases/tag/juniper-v0.15.8) - -- Fix panic on malformed queries with recursive fragments. *This is a potential denial-of-service attack vector.* Thanks to [@quapka](https://github.com/quapka) for the detailed vulnerability report and reproduction steps. - -# [[0.15.7] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper-v0.15.7) - -- Fix panic on spreading untyped union fragments ([#945](https://github.com/graphql-rust/juniper/issues/945)) - -# [[0.15.6] 2021-06-07](https://github.com/graphql-rust/juniper/releases/tag/juniper-v0.15.6) - -- Allow `RootNode::as_schema_language` and `RootNode::as_parser_document` for arbitrary type info ([#935](https://github.com/graphql-rust/juniper/pull/935)) - -# [[0.15.5] 2021-05-11](https://github.com/graphql-rust/juniper/releases/tag/juniper-v0.15.5) - -- Fix multiple fragments on sub types overriding each other ([#927](https://github.com/graphql-rust/juniper/pull/915)) -- Fix error extensions in subscriptions ([#927](https://github.com/graphql-rust/juniper/pull/927)) -- Fix fields on interfaces not being resolved when used with fragments ([#923](https://github.com/graphql-rust/juniper/pull/923)) - -# [[0.15.4] 2021-04-03](https://github.com/graphql-rust/juniper/releases/tag/juniper-v0.15.4) - -- Un-deprecate select_child, has_child, and child_names methods ([#900](https://github.com/graphql-rust/juniper/pull/#900)) - -# [[0.15.3] 2021-01-27](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.15.3) - -- Compatibility with the latest `syn` ([#861](https://github.com/graphql-rust/juniper/pull/861)) -- Fixed a regression in GraphQL Playground ([#856](https://github.com/graphql-rust/juniper/pull/856)) - -# [[0.15.2] 2021-01-15](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.15.2) - -- Update GraphQL Playground to v1.7.27. -- Add marker GraphQL trait implementations for Rust container types like `Box`([#847](https://github.com/graphql-rust/juniper/pull/847)) - -# [[0.15.1] 2020-12-12](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.15.1) - -- Support `Arc` in input and output objects. ([#822](https://github.com/graphql-rust/juniper/pull/822)) - -# [[0.15.0] 2020-12-09](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.15.0) - -## Features - -- Added async support. ([#2](https://github.com/graphql-rust/juniper/issues/2)) - - `execute()` is now async. Synchronous execution can still be used via `execute_sync()`. - - Field resolvers may optionally be declared as `async` and return a future. - -- Added *experimental* support for GraphQL subscriptions. ([#433](https://github.com/graphql-rust/juniper/pull/433)) - -- Added support for generating the [GraphQL Schema Language](https://graphql.org/learn/schema/#type-language) representation of a schema using `RootNode::as_schema_language()`. ([#676](https://github.com/graphql-rust/juniper/pull/676)) - - This is controlled by the `schema-language` feature and is on by default. It may be turned off if you do not need this functionality to reduce dependencies and speed up compile times. - - Note that this is for generating the GraphQL Schema Language representation from the Rust schema. For the opposite--generating a Rust schema from a GraphQL Schema Language file--see the [`juniper_from_schema`](https://github.com/davidpdrsn/juniper-from-schema) project. - -- Most GraphQL spec violations are now caught at compile-time. ([#631](https://github.com/graphql-rust/juniper/pull/631)) - - The enhanced error messages now include the reason and a link to the spec. - For example, if you try to declare a GraphQL object with no fields: - ```rust - error: GraphQL object expects at least one field - --> $DIR/impl_no_fields.rs:4:1 - | - 4 | impl Object {} - | ^^^^^^^^^^^^^^ - | - = note: https://spec.graphql.org/June2018/#sec-Objects - ``` - -- [Raw identifiers](https://doc.rust-lang.org/edition-guide/rust-2018/module-system/raw-identifiers.html) are now supported in field and argument names. - -- Most error types now implement `std::error::Error`. ([#419](https://github.com/graphql-rust/juniper/pull/419)) - - `GraphQLError` - - `LexerError` - - `ParseError` - - `RuleError` - -- Support `chrono-tz::Tz` scalar behind a `chrono-tz` feature flag. ([#519](https://github.com/graphql-rust/juniper/pull/519)) - -- Added support for distinguishing between between implicit and explicit null. ([#795](https://github.com/graphql-rust/juniper/pull/795)) - -- Implement `IntoFieldError` for `std::convert::Infallible`. ([#796](https://github.com/graphql-rust/juniper/pull/796)) - -- Allow using `#[graphql(Scalar = DefaultScalarValue)]` for derive macro `GraphQLScalarValue` ([#807](https://github.com/graphql-rust/juniper/pull/807)) - -## Fixes - -- Massively improved the `#[graphql_union]` proc macro. ([#666](https://github.com/graphql-rust/juniper/pull/666)): - - Applicable to traits. - - Supports custom resolvers. - - Supports generics. - - Supports multiple `#[graphql_union]` attributes. - -- Massively improved the `#[derive(GraphQLUnion)]` macro. ([#666](https://github.com/graphql-rust/juniper/pull/666)): - - Applicable to enums and structs. - - Supports custom resolvers. - - Supports generics. - - Supports multiple `#[graphql]` attributes. - -- Massively improved the `#[graphql_interface]` macro. ([#682](https://github.com/graphql-rust/juniper/pull/682)): - - Applicable to traits and generates enum or trait object to represent a GraphQL interface (see the [example of migration from `graphql_interface!` macro](https://github.com/graphql-rust/juniper/commit/3472fe6d10d23472752b1a4cd26c6f3da767ae0e#diff-3506bce1e02051ceed41963a86ef59d660ee7d0cd26df1e9c87372918e3b01f0)). - - Supports passing context and executor to a field resolver. - - Supports custom downcast functions and methods. - - Supports generics. - - Supports multiple `#[graphql_interface]` attributes. - -- The `GraphQLEnum` derive now supports specifying a custom context. ([#621](https://github.com/graphql-rust/juniper/pull/621)) - - Example: - ```rust - #[derive(juniper::GraphQLEnum)] - #[graphql(context = CustomContext)] - enum TestEnum { - A, - } - ``` - -- Added support for renaming arguments within a GraphQL object. ([#631](https://github.com/graphql-rust/juniper/pull/631)) - - Example: - ```rust - #[graphql(arguments(argA(name = "test")))] - ``` - -- `SchemaType` is now public. - - This is helpful when using `context.getSchema()` inside of your field resolvers. - -- Improved lookahead visibility for aliased fields. ([#662](https://github.com/graphql-rust/juniper/pull/662)) - -- When enabled, the optional `bson` integration now requires `bson-1.0.0`. ([#678](https://github.com/graphql-rust/juniper/pull/678)) - -- Fixed panic on `executor.look_ahead()` for nested fragments ([#500](https://github.com/graphql-rust/juniper/issues/500)) - -## Breaking Changes - -- `GraphQLType` trait was split into 2 traits: ([#685](https://github.com/graphql-rust/juniper/pull/685)) - - An object-safe `GraphQLValue` trait containing resolving logic. - - A static `GraphQLType` trait containing GraphQL type information. - -- `juniper::graphiql` has moved to `juniper::http::graphiql`. - - `juniper::http::graphiql::graphiql_source()` now requires a second parameter for subscriptions. - -- Renamed the `object` proc macro to `graphql_object`. -- Removed the `graphql_object!` macro. Use the `#[graphql_object]` proc macro instead. -- Made `#[graphql_object]` macro to generate code generic over `ScalarValue` by default. ([#779](https://github.com/graphql-rust/juniper/pull/779)) - -- Renamed the `scalar` proc macro to `graphql_scalar`. -- Removed the `graphql_scalar!` macro. Use the `#[graphql_scalar]` proc macro instead. - -- Removed the deprecated `ScalarValue` custom derive. Use `GraphQLScalarValue` instead. - -- Removed the `graphql_interface!` macro. Use the `#[graphql_interface]` proc macro instead. - -- Removed the `graphql_union!` macro. Use the `#[graphql_union]` proc macro or custom resolvers for the `#[derive(GraphQLUnion)]` instead. - -- The `#[derive(GraphQLUnion)]` macro no longer generates `From` impls for enum variants. ([#666](https://github.com/graphql-rust/juniper/pull/666)) - - Consider using the [`derive_more`](https//docs.rs/derive_more) crate directly. - -- The `ScalarRefValue` trait has been removed as it was not required. - -- Prefixing variables or fields with an underscore now matches Rust's behavior. ([#684](https://github.com/graphql-rust/juniper/pull/684)) - -- The return type of `GraphQLType::resolve()` has been changed to `ExecutionResult`. - - This was done to unify the return type of all resolver methods. The previous `Value` return type was just an internal artifact of - error handling. - -- Subscription-related: - - Add subscription type to `RootNode`. - - Add subscription endpoint to `playground_source()`. - - Add subscription endpoint to `graphiql_source()`. - -- Specifying a scalar type via a string is no longer supported. ([#631](https://github.com/graphql-rust/juniper/pull/631)) - - For example, instead of `#[graphql(scalar = "DefaultScalarValue")]` use `#[graphql(scalar = DefaultScalarValue)]`. *Note the lack of quotes*. - -- Integration tests: - - Renamed `http::tests::HTTPIntegration` as `http::tests::HttpIntegration`. - - Added support for `application/graphql` POST request. - -- `RootNode::new()` now returns `RootNode` parametrized with `DefaultScalarValue`. For custom `ScalarValue` use `RootNode::new_with_scalar_value()` instead. ([#779](https://github.com/graphql-rust/juniper/pull/779)) - -- When using `LookAheadMethods` to access child selections, children are always found using their alias if it exists rather than their name. ([#662](https://github.com/graphql-rust/juniper/pull/662)) - - These methods are also deprecated in favor of the new `LookAheadMethods::children()` method. - -# [[0.14.2] 2019-12-16](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.14.2) - -- Fix incorrect validation with non-executed operations [#455](https://github.com/graphql-rust/juniper/issues/455) -- Correctly handle raw identifiers in field and argument names. - -# [[0.14.1] 2019-10-24](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.14.1) - -- Fix panic when an invalid scalar is used by a client [#434](https://github.com/graphql-rust/juniper/pull/434) -- `EmptyMutation` now implements `Send` [#443](https://github.com/graphql-rust/juniper/pull/443) - -# [[0.14.0] 2019-09-29](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.14.0) - -- Require `url` 2.x if `url` feature is enabled. -- Improve lookahead visitability. -- Add ability to parse 'subscription'. - -# [[0.13.1] 2019-07-29](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.13.1) - -- Fix a regression when using lookaheads with fragments containing nested types [#404](https://github.com/graphql-rust/juniper/pull/404) - -- Allow `mut` arguments for resolver functions in `#[object]` macros [#402](https://github.com/graphql-rust/juniper/pull/402) - -# [[0.13.0] 2019-07-19](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.13.0) - -### newtype ScalarValue derive - -See [#345](https://github.com/graphql-rust/juniper/pull/345). - -The newtype pattern can now be used with the `GraphQLScalarValue` custom derive -to easily implement custom scalar values that just wrap another scalar, -similar to serdes `#[serde(transparent)]` functionality. - -Example: - -```rust -#[derive(juniper::GraphQLScalarValue)] -struct UserId(i32); -``` - -### Other Changes - -- The `ID` scalar now implements Serde's `Serialize` and `Deserialize` -- Add support for `dyn` trait object syntax to procedural macros - -# [[0.12.0] 2019-05-16](https://github.com/graphql-rust/juniper/releases/tag/juniper-0.12.0) - -### object macro - -The `graphql_object!` macro is deprecated and will be removed in the future. -It is replaced by the new [object](https://docs.rs/juniper/latest/juniper/macro.object.html) procedural macro. - -[#333](https://github.com/graphql-rust/juniper/pull/333) - -### 2018 Edition - -All crates were refactored to the Rust 2018 edition. - -This should not have any impact on your code, since juniper already was 2018 compatible. - -[#345](https://github.com/graphql-rust/juniper/pull/345) - -### Other changes - -- The minimum required Rust version is now `1.34.0`. -- The `GraphQLType` impl for () was removed to improve compile time safefty. [#355](https://github.com/graphql-rust/juniper/pull/355) -- The `ScalarValue` custom derive has been renamed to `GraphQLScalarValue`. -- Added built-in support for the canonical schema introspection query via - `juniper::introspect()`. - [#307](https://github.com/graphql-rust/juniper/issues/307) -- Fix introspection query validity - The DirectiveLocation::InlineFragment had an invalid literal value, - which broke third party tools like apollo cli. -- Added GraphQL Playground integration. - The `DirectiveLocation::InlineFragment` had an invalid literal value, - which broke third party tools like apollo cli. -- The return type of `value::object::Object::iter/iter_mut` has changed to `impl Iter`. [#312](https://github.com/graphql-rust/juniper/pull/312) -- Add `GraphQLRequest::operation_name` [#353](https://github.com/graphql-rust/juniper/pull/353) - -# [0.11.1] 2018-12-19 - -## Changes - -- The minimum required Rust version is now `1.30`. -- All macros and the custom derives now support the macro system changes properly - and also support Rust 2018 edition crates. - - [#298](https://github.com/graphql-rust/juniper/pull/298) - -# [0.11.0] 2018-12-17 - -## Changes - -- The minimum required Rust version is now `1.30.0`. - - [#271](https://github.com/graphql-rust/juniper/pull/271) - -- Juniper is now generic about the exact representation of scalar values. This - allows downstream crates to add support for own scalar value representations. - - There are two use cases for this feature: - - - You want to support new scalar types not representable by the provided default - scalar value representation like for example `i64` - - You want to support a type from a third party crate that is not supported by juniper - - **Note:** This may need some changes in down stream code, especially if working with - generic code. To retain the current behaviour use `DefaultScalarValue` as scalar value type - - [#251](https://github.com/graphql-rust/juniper/pull/251) - -- The `GraphQLObject` and `GraphQLEnum` derives will mark graphql fields as - `@deprecated` when struct fields or enum variants are marked with the - builtin `#[deprecated]` attribute. - - The deprecation reason can be set using the `note = ...` meta item - (e.g. `#[deprecated(note = "Replaced by betterField")]`). - The `since` attribute is ignored. - - [#269](https://github.com/graphql-rust/juniper/pull/269) - -* There is an alternative syntax for setting a field's _description_ and - _deprecation reason_ in the `graphql_object!` and `graphql_interface!` macros. - - To **deprecate** a graphql field: - - ```rust - // Original syntax for setting deprecation reason - field deprecated "Reason" my_field() -> { ... } - - // New alternative syntax for deprecation reason. - #[deprecated(note = "Reason")] - field my_field() -> { ... } - - // You can now also deprecate without a reason. - #[deprecated] - field my_field() -> { ... } - ``` - - To set the **description** of a graphql field: - - ```rust - // Original syntax for field descriptions - field my_field() as "Description" -> { ... } - - // Original syntax for argument descriptions - field my_field( - floops: i32 as "The number of starfish to be returned. \ - Can't be more than 100.", - ) -> { - ... - } - - // New alternative syntax for field descriptions - /// Description - field my_field() -> { ... } - - // New alternative syntax for argument descriptions - field my_field( - /// The number of starfish to be returned. - /// Can't be more than 100. - arg: i32, - ) -> { - ... - } - - // You can also use raw strings and const &'static str. - // - // Multiple docstrings will be collapsed into a single - // description separated by newlines. - /// This is my field. - /// - /// Make sure not to filtz the bitlet. - /// Flitzing without a bitlet has undefined behaviour. - /// - #[doc = my_consts::ADDED_IN_VERSION_XYZ] - field my_field() -> { ... } - ``` - - [#269](https://github.com/graphql-rust/juniper/pull/269) - -# [0.10.0] 2018-09-13 - -## Changes - -- Changed serialization of `NaiveDate` when using the optional `chronos` support. - - **Note:** while this is not a Rust breaking change, if you relied on the serialization format (perhaps by storing serialized data in a database or making asumptions in your client code written in another language) it could be a breaking change for your application. - - [#151](https://github.com/graphql-rust/juniper/pull/151) - -- The `GraphQLObject`, `GraphQLInputObject`, and `GraphQLEnum` custom derives will reject - invalid [names](http://facebook.github.io/graphql/October2016/#Name) at compile time. - - [#170](https://github.com/graphql-rust/juniper/pull/170) - -- Large integers (> signed 32bit) are now deserialized as floats. Previously, - they produced an "integer out of range" error. For languages that do not - have a distinction between integer and floating point types (such as - javascript), this meant large whole floating point values could not be - decoded (because they were represented without a fractional value such as `.0`). - - [#179](https://github.com/graphql-rust/juniper/pull/179) - -- The `GraphQLObject`, `GraphQLInputObject`, and `GraphQLEnum` custom derives - now parse doc strings and use them as descriptions. This behavior can be - overridden by using an explicit GraphQL `description` annotation such as - `#[graphql(description = "my description")]`. [View documentation](https://graphql-rust.github.io/types/objects/defining_objects.html#defining-objects). - - [#194](https://github.com/graphql-rust/juniper/issues/194) - -- Introduced `IntoFieldError` trait to allow custom error handling - i.e. custom result type. The error type must implement this trait resolving - the errors into `FieldError`. [View documentation](https://graphql-rust.github.io/types/objects/error_handling.html#structured-errors). - - [#40](https://github.com/graphql-rust/juniper/issues/40) - -- `GraphQLType` and `ToInputValue` are now implemented for Arc - - [#212](https://github.com/graphql-rust/juniper/pull/212) - -- Error responses no longer have a _data_ field, instead, error details are stored in the _extensions_ field - - **Note:** while this is a breaking change, it is a necessary one to better align with the latest [GraphQL June 2018](https://facebook.github.io/graphql/June2018/#sec-Errors) specification, which defines the reserved _extensions_ field for error details. [View documentation](https://graphql-rust.github.io/types/objects/error_handling.html#structured-errors). - - [#219](https://github.com/graphql-rust/juniper/pull/219) - -* The `GraphQLObject` and `GraphQLInputObject` custom derives - now support lifetime annotations. - - [#225](https://github.com/graphql-rust/juniper/issues/225) - -* When using the `GraphQLObject` custom derive, fields can now be omitted by annotating the field with `#[graphql(skip)]`. [View documentation](https://graphql-rust.github.io/types/objects/defining_objects.html#skipping-fields). - - [#220](https://github.com/graphql-rust/juniper/issues/220) - -* Due to newer dependencies, the oldest Rust version supported is now 1.22.0 - - [#231](https://github.com/graphql-rust/juniper/pull/231) - -# [0.9.2] 2018-01-13 - -## Changes - -### `__typename` for unions - -The [`__typename`](http://graphql.org/learn/queries/#meta-fields) query meta-field now works on unions. - -[#112](https://github.com/graphql-rust/juniper/issues/112) - -### Debug impls. - -http::GraphQLRequest now implements `Debug`. - -# [0.9.0] 2017-12-03 - -## Changes - -This is the first release in a long time. -Quite a few changes have accumulated since `0.8.1`, including multiple breaking -changes. - -### Custom derive & macros - -Juniper has gained custom derive implementations for input objects, objects and -enums. - -- `#[derive(GraphQLInputObject)]` -- `#[derive(GraphQLEnum)]` -- `#[derive(GraphQLObject)]` - -The `graphql_enum!` and `graphql_input_object!` macros did not provide any more -benefits, so they have been removed! -All functionality is now covered by custom derive. -Check the [docs](https://graphql-rust.github.io) to find out more. - -### Web framework integrations - Iron & Rocket - -The iron and rocket integrations were removed from the main crate, and are now -available via the [juniper_iron](https://crates.io/crates/juniper_iron) and -[juniper_rocket](https://crates.io/crates/juniper_rocket) crates. - -### FieldError rewrite (custom data) - -The `FieldError` type now supports custom data with the `Value` type from -serde_json. Use this to populate the `data` field in returned errors. - -This also means that try! and `?` now work in resolvers, which is quite nice. - -Also, the `ResultExt` extension and the `jtry!` macro were removed, since they -are redundant now! - -### Dynamic Schemas - -Juniper has gained support for dynamic schemas, thanks to @srijs. - -That also means the type of `RootNode` has changed to include a lifetime. - -The repository was restructured to a multi crate workspace to enable several new -features like custom_derive and an extracted parser. - -#[#66](https://github.com/graphql-rust/juniper/pull/66) - -### Data Type Integrations - -Integrations with multiple popular crates was added to make working with them -easier. - -- uuid -- url -- chrono - -### Field Order - -To better comply with the specification, order of requested fields is -now preserved. - -[#82](https://github.com/graphql-rust/juniper/issues/82 - -### From/ToInputValue - -The `::from` and `::to` methods in `From/ToInputValue` were renamed to -`from/to_input_value()` to not conflict with other methods. - -[#90](https://github.com/graphql-rust/juniper/pull/90) - -### Other changes - -- Several small performance improvements -- Use [fnv](https://github.com/servo/rust-fnv) hash map for better performance - -## Contributors - -A big shoutout to the many contributors for this version, sorted alphabetically. - -- Cameron Eldridge -- Christian Legnitto -- Jacob Haslehurst -- Jane Keibler -- Magnus Hallin -- rushmorem -- Rushmore Mushambi -- Sagie Gur-Ari -- Sam Rijs -- Stanko Krtalić -- theduke -- thomas-jeepe - -# [0.8.1] – 2017-06-15 - -Tiny release to fix broken crate metadata on crates.io. - -# [0.8.0] – 2017-06-15 - -## Breaking changes - -- To better comply with the specification, and to avoid weird bugs with very - large positive or negative integers, support for `i64` has been completely - dropped and replaced with `i32`. `i64` is no longer a valid GraphQL type in - Juniper, and `InputValue`/`Value` can only represent 32 bit integers. - - If an incoming integer is out of range for a 32 bit signed integer type, an - error will be returned to the client. - ([#52](https://github.com/graphql-rust/juniper/issues/52), - [#49](https://github.com/graphql-rust/juniper/issues/49)) - -- Serde has been updated to 1.0. If your application depends on an older - version, you will need to first update your application before you can upgrade - to a more recent Juniper. ([#43](https://github.com/graphql-rust/juniper/pull/43)) - -- `rustc_serialize` support has been dropped since this library is now - deprecated. ([#51](https://github.com/graphql-rust/juniper/pull/51)) - -## New features - -- A new `rocket-handlers` feature now includes some tools to use the - [Rocket](https://rocket.rs) framework. [A simple - example](juniper_rocket/examples/rocket-server.rs) has been added to the examples folder. - -## Bugfixes - -- A panic in the parser has been replaced with a proper error - ([#44](https://github.com/graphql-rust/juniper/pull/44)) - -# [0.7.0] – 2017-02-26 - -### Breaking changes - -- The `iron-handlers` feature now depends on Iron 0.5 - ([#30](https://github.com/graphql-rust/juniper/pull/30)). Because of - this, support for Rust 1.12 has been dropped. It might still work if - you're not using the Iron integrations feature, however. - -### New features - -- Input objects defined by the `graphql_input_object!` can now be used - as default values to field arguments and other input object fields. - -# [0.6.3] – 2017-02-19 - -### New features - -- Add support for default values on input object fields - ([#28](https://github.com/graphql-rust/juniper/issues/28)) - -# [0.6.2] – 2017-02-05 - -### New features - -- The `null` literal is now supported in the GraphQL - language. ([#26](https://github.com/graphql-rust/juniper/pull/26)) -- Rustc-serialize is now optional, but enabled by default. If you - _only_ want Serde support, include Juniper without default features - and enable - Serde. ([#12](https://github.com/graphql-rust/juniper/pull/12)) -- The built-in `ID` type now has a public constructor and derives a - few traits (`Clone`, `Debug`, `Eq`, `PartialEq`, `From`, - `Deref`). ([#19](https://github.com/graphql-rust/juniper/pull/19)) -- Juniper is now built and tested against all Rust compilers since - version 1.12.1. - -### Minor breaking change - -- Serde has been updated to - 0.9. ([#25](https://github.com/graphql-rust/juniper/pull/25)) - -### Bugfixes - -- The built-in GraphiQL handler had a bug in variable serialization. - ([#16](https://github.com/graphql-rust/juniper/pull/16)) -- The example should now build and run without problems on - Windows. ([#15](https://github.com/graphql-rust/juniper/pull/15)) -- Object types now properly implement - `__typename`. ([#22](https://github.com/graphql-rust/juniper/pull/22)) -- String variables are now properly parsed into GraphQL - enums. ([#17](https://github.com/graphql-rust/juniper/pull/17)) - -# [0.6.1] – 2017-01-06 - -### New features - -- Optional Serde support - ([#8](https://github.com/graphql-rust/juniper/pull/8)) - -### Improvements - -- The `graphql_input_object!` macro can now be used to define input - objects as public Rust structs. -- GraphiQL in the Iron GraphiQL handler has been updated to 0.8.1 - (#[#11](https://github.com/graphql-rust/juniper/pull/11)) - -### Minor breaking changes - -Some undocumented but public APIs were changed. - -- `to_snake_case` correctly renamed to `to_camel_case` - ([#9](https://github.com/graphql-rust/juniper/pull/9)) -- JSON serialization of `GraphQLError` changed to be more consistent - with how other values were serialized - ([#10](https://github.com/graphql-rust/juniper/pull/10)). - -# [0.6.0] – 2017-01-02 - -TL;DR: Many big changes in how context types work and how they -interact with the executor. Not too much to worry about if you're only -using the macros and not deriving `GraphQLType` directly. - -### Breaking changes - -- The `executor` argument in all resolver methods is now - immutable. The executor instead uses interior mutability to store - errors in a thread-safe manner. - - This change could open up for asynchronous or multi-threaded - execution: you can today use something like rayon in your resolve - methods to let child nodes be concurrently resolved. - - **How to fix:** All field resolvers that looked like `field name(&mut executor` now should say `field name(&executor`. - -- The context type of `GraphQLType` is moved to an associated type; - meaning it's no longer generic. This only affects people who - implement the trait manually, _not_ macro users. - - This greatly simplifies a lot of code by ensuring that there only - can be one `GraphQLType` implementation for any given Rust - type. However, it has the downside that support for generic contexts - previously used in scalars, has been removed. Instead, use the new - context conversion features to accomplish the same task. - - **How to fix:** Instead of `impl GraphQLType for ...`, - you use `impl GraphQLType for ... { type Context = MyContext;`. - -- All context types must derive the `Context` marker trait. This is - part of an overarching change to allow different types to use - different contexts. - - **How to fix:** If you have written e.g. `graphql_object!(MyType: MyContext ...)` you will need to add `impl Context for MyContext {}`. Simple as that. - -- `Registry` and all meta type structs now takes one lifetime - parameter, which affects `GraphQLType`'s `meta` method. This only - affects people who implement the trait manually. - - **How to fix:** Change the type signature of `meta()` to read `fn meta<'r>(registry: &mut Registry<'r>) -> MetaType<'r>`. - -- The type builder methods on `Registry` no longer return functions - taking types or fields. Due to how the borrow checker works with - expressions, you will have to split up the instantiation into two - statements. This only affects people who implement the `GraphQLType` - trait manually. - - **How to fix:** Change the contents of your `meta()` methods to - something like this: - - ```rust - fn meta<'r>(registry: &mut Registry) -> MetaType<'r> { - let fields = &[ /* your fields ... */ ]; - - registry.build_object_type::(fields).into_meta() - } - ``` +`juniper` changelog +=================== + +All user visible changes to `juniper` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. + + + + +## master + +[Diff](/../../compare/juniper-v0.15.9...master) + +### BC Breaks + +- [October 2021] GraphQL spec: ([#1000]) + - Forbade [`__typename` field on `subscription` operations](https://spec.graphql.org/October2021#note-bc213). ([#1001]) + - Supported `isRepeatable` field on directives. ([#1003]) + - Supported `__Schema.description`, `__Type.specifiedByURL` and `__Directive.isRepeatable` fields in introspection. ([#1003]) + - Supported directives on variables definitions. ([#1005]) +- Replaced `Visitor` associated type with `DeserializeOwned` requirement in `ScalarValue` trait. ([#985]) +- `#[graphql_object]` and `#[graphql_subscription]` expansions now preserve defined `impl` blocks "as is" and reuse defined methods in opaque way. ([#971]) +- Renamed `rename = ""` attribute argument to `rename_all = ""` (following `serde` style). ([#971]) +- Upgraded [`bson` crate] integration to [2.0 version](https://github.com/mongodb/bson-rust/releases/tag/v2.0.0). ([#979]) +- Made `FromInputValue` trait methods fallible to allow post-validation. ([#987]) +- Redesigned `#[graphql_interface]` macro: ([#1009]) + - Removed support for `dyn` attribute argument (interface values as trait objects). + - Removed support for `downcast` attribute argument (custom resolution into implementer types). + - Removed support for `async` trait methods (not required anymore). + - Removed necessity of writing `impl Trait for Type` blocks (interfaces are implemented just by matching their fields now). + - Forbade default implementations of non-ignored trait methods. + - Supported coercion of additional `null`able arguments and return sub-typing on implementer. + - Supported `rename_all = ""` attribute argument influencing all its fields and their arguments. ([#971]) +- Split `#[derive(GraphQLScalarValue)]` macro into: + - `#[derive(GraphQLScalar)]` for implementing GraphQL scalar: ([#1017]) + - Supported generic `ScalarValue`. + - Supported structs with single named field. + - Supported overriding resolvers with external functions, methods or modules. + - Supported `specified_by_url` attribute argument. ([#1003], [#1000]) + - `#[derive(ScalarValue)]` for implementing `ScalarValue` trait: ([#1025]) + - Removed `Serialize` implementation (now should be provided explicitly). ([#985]) +- Redesigned `#[graphql_scalar]` macro: ([#1014]) + - Changed `from_input_value()` return type from `Option` to `Result`. ([#987]) + - Mirrored new `#[derive(GraphQLScalar)]` macro. + - Supported usage on type aliases in case `#[derive(GraphQLScalar)]` isn't applicable because of [orphan rules]. +- Renamed `ScalarValue::as_boolean` method to `ScalarValue::as_bool`. ([#1025]) +- Reworked [`chrono` crate] integration GraphQL scalars according to [graphql-scalars.dev] specs: ([#1010]) + - Disabled `chrono` [Cargo feature] by default. + - Removed `scalar-naivetime` [Cargo feature]. ### Added -- Support for different contexts for different types. As GraphQL - schemas tend to get large, narrowing down the context type to - exactly what a given type needs is great for - encapsulation. Similarly, letting different subsystems use different - resources thorugh the context is also useful for the same reasons. +- Usage of Rust arrays as GraphQL lists. ([#966], [#918]) +- `From` implementations for `InputValue` mirroring the ones for `Value` and better support for `Option` handling. ([#996]) +- `null` in addition to `None` for creating `Value::Null` in `graphql_value!` macro (following `serde_json::json!` style). ([#996]) +- `graphql_input_value!` and `graphql_vars!` macros. ([#996]) +- [`time` crate] integration behind `time` [Cargo feature]. ([#1006]) +- `#[derive(GraphQLInterface)]` macro allowing using structs as GraphQL interfaces. ([#1026]) - Juniper supports two different methods of doing this, depending on - your needs: if you have two contexts where one can be converted into - the other _without any extra knowledge_, you can implement the new - `FromContext` trait. This is useful if you have multiple crates or - modules that all belong to the same GraphQL schema: +### Changed - ```rust - struct TopContext { - db: DatabaseConnection, - session: WebSession, - current_user: User, - } +- Made `GraphQLRequest` fields public. ([#750]) - struct ModuleOneContext { - db: DatabaseConnection, // This module only requires a database connection - } +## Fixed - impl Context for TopContext {} - impl Context for ModuleOneContext {} +- Unsupported spreading GraphQL interface fragments on unions and other interfaces. ([#965], [#798]) +- Unsupported expressions in `graphql_value!` macro. ([#996], [#503]) +- Incorrect GraphQL list coercion rules: `null` cannot be coerced to an `[Int!]!` or `[Int]!`. ([#1004]) - impl FromContext for ModuleOneContext { - fn from(ctx: &TopContext) -> ModuleOneContext { - ModuleOneContext { - db: ctx.db.clone() - } - } - } +[#503]: /../../issues/503 +[#750]: /../../issues/750 +[#798]: /../../issues/798 +[#918]: /../../issues/918 +[#965]: /../../pull/965 +[#966]: /../../pull/966 +[#971]: /../../pull/971 +[#979]: /../../pull/979 +[#985]: /../../pull/985 +[#987]: /../../pull/987 +[#996]: /../../pull/996 +[#1000]: /../../issues/1000 +[#1001]: /../../pull/1001 +[#1003]: /../../pull/1003 +[#1004]: /../../pull/1004 +[#1005]: /../../pull/1005 +[#1006]: /../../pull/1006 +[#1009]: /../../pull/1009 +[#1010]: /../../pull/1010 +[#1014]: /../../pull/1014 +[#1017]: /../../pull/1017 +[#1025]: /../../pull/1025 +[#1026]: /../../pull/1026 - graphql_object!(Query: TopContext |&self| { - field item(&executor) -> Item { - executor.context().db.get_item() - } - }); - // The `Item` type uses another context type - conversion is automatic - graphql_object!(Item: ModuleOneContext |&self| { - // ... - }); - ``` - The other way is to manually perform the conversion in a field - resolver. This method is preferred when the child context needs - extra knowledge than what exists in the parent context: - ```rust - // Each entity has its own context - struct TopContext { - entities: HashMap, - db: DatabaseConnection, - } +## Previous releases - struct EntityContext { - // fields - } +See [old CHANGELOG](/../../blob/juniper-v0.15.9/juniper/CHANGELOG.md). - impl Context for TopContext {} - impl Context for EntityContext {} - graphql_object!(Query: TopContext |&self| { - // By returning a tuple (&Context, GraphQLType), you can tell the executor - // to switch out the context for the returned value. You can wrap the - // tuple in Option<>, FieldResult<>, FieldResult>, or just return - // the tuple without wrapping it. - field entity(&executor, key: i32) -> Option<(&EntityContext, Entity)> { - executor.context().entities.get(&key) - .map(|ctx| (ctx, executor.context().db.get_entity(key))) - } - }); - graphql_object!(Entity: EntityContext |&self| { - // ... - }); - ``` -### Improvements - -- Parser and query execution has now reduced the allocation overhead - by reusing as much as possible from the query source and meta type - information. - -# [0.5.3] – 2016-12-05 - -### Added - -- `jtry!`: Helper macro to produce `FieldResult`s from regular - `Result`s. Wherever you would be using `try!` in a regular function - or method, you can use `jtry!` in a field resolver: - - ```rust - graphql_object(MyType: Database |&self| { - field count(&executor) -> FieldResult { - let txn = jtry!(executor.context().transaction()); - - let count = jtry!(txn.execute("SELECT COUNT(*) FROM user")); - - Ok(count[0][0]) - } - }); - ``` - -### Changes - -- Relax context type trait requirements for the iron handler: your - contexts no longer have to be `Send + Sync`. - -- `RootNode` is now `Send` and `Sync` if both the mutation and query - types implement `Send` and `Sync`. - -### Bugfixes - -- `return` statements inside field resolvers no longer cause syntax - errors. - -## 0.5.2 – 2016-11-13 - -### Added - -- Support for marking fields and enum values deprecated. -- `input_object!` helper macro - -### Changes - -- The included example server now uses the simple Star Wars schema - used in query/introspection tests. - -### Bugfixes - -- The query validators - particularly ones concerned with validation - of input data and variables - have been improved significantly. A - large number of test cases have been added. - -- Macro syntax stability has also been improved. All syntactical edge - cases of the macros have gotten tests to verify their correctness. - -[0.8.1]: https://github.com/graphql-rust/juniper/compare/0.8.0...0.8.1 -[0.8.0]: https://github.com/graphql-rust/juniper/compare/0.7.0...0.8.0 -[0.7.0]: https://github.com/graphql-rust/juniper/compare/0.6.3...0.7.0 -[0.6.3]: https://github.com/graphql-rust/juniper/compare/0.6.2...0.6.3 -[0.6.2]: https://github.com/graphql-rust/juniper/compare/0.6.1...0.6.2 -[0.6.1]: https://github.com/graphql-rust/juniper/compare/0.6.0...0.6.1 -[0.6.0]: https://github.com/graphql-rust/juniper/compare/0.5.3...0.6.0 -[0.5.3]: https://github.com/graphql-rust/juniper/compare/0.5.2...0.5.3 +[`bson` crate]: https://docs.rs/bson +[`chrono` crate]: https://docs.rs/chrono +[`time` crate]: https://docs.rs/time +[Cargo feature]: https://doc.rust-lang.org/cargo/reference/features.html +[graphql-scalars.dev]: https://graphql-scalars.dev +[October 2021]: https://spec.graphql.org/October2021 +[orphan rules]: https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml index db67b6f1..8fde8317 100644 --- a/juniper/Cargo.toml +++ b/juniper/Cargo.toml @@ -1,22 +1,27 @@ [package] name = "juniper" version = "0.16.0-dev" +edition = "2018" +description = "GraphQL server library." +license = "BSD-2-Clause" authors = [ "Magnus Hallin ", "Christoph Herzog ", "Christian Legnitto ", + "Ilya Solovyiov ", + "Kai Ren ", ] -description = "GraphQL server library" -license = "BSD-2-Clause" documentation = "https://docs.rs/juniper" +homepage = "https://graphql-rust.github.io" repository = "https://github.com/graphql-rust/juniper" -readme = "../README.md" -keywords = ["graphql", "server", "web", "rocket"] -categories = ["web-programming"] -edition = "2018" +readme = "README.md" +categories = ["asynchronous", "web-programming", "web-programming::http-server"] +keywords = ["apollo", "graphql", "server", "web"] +exclude = ["/release.toml"] -[badges] -travis-ci = { repository = "graphql-rust/juniper" } +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] [features] default = [ @@ -27,22 +32,20 @@ default = [ ] chrono-clock = ["chrono", "chrono/clock"] expose-test-schema = ["anyhow", "serde_json"] -graphql-parser-integration = ["graphql-parser"] -schema-language = ["graphql-parser-integration"] +schema-language = ["graphql-parser"] [dependencies] -juniper_codegen = { version = "0.16.0-dev", path = "../juniper_codegen" } - -anyhow = { version = "1.0.32", optional = true, default-features = false } +anyhow = { version = "1.0.32", default-features = false, optional = true } async-trait = "0.1.39" bson = { version = "2.0", features = ["chrono-0_4"], optional = true } -chrono = { version = "0.4", default-features = false, optional = true } +chrono = { version = "0.4", features = ["alloc"], default-features = false, optional = true } chrono-tz = { version = "0.6", default-features = false, optional = true } fnv = "1.0.3" futures = { version = "0.3.1", features = ["alloc"], default-features = false } futures-enum = { version = "0.1.12", default-features = false } graphql-parser = { version = "0.4", optional = true } indexmap = { version = "1.0", features = ["serde-1"] } +juniper_codegen = { version = "0.16.0-dev", path = "../juniper_codegen" } serde = { version = "1.0.8", features = ["derive"], default-features = false } serde_json = { version = "1.0.2", default-features = false, optional = true } smartstring = "1.0" @@ -61,7 +64,7 @@ uuid = { version = "0.8", default-features = false, features = ["wasm-bindgen"], bencher = "0.1.2" pretty_assertions = "1.0.0" serde_json = "1.0.2" -tokio = { version = "1", features = ["macros", "time", "rt-multi-thread"] } +tokio = { version = "1.0", features = ["macros", "time", "rt-multi-thread"] } [[bench]] name = "bench" diff --git a/juniper/LICENSE b/juniper/LICENSE new file mode 100644 index 00000000..f1c4508b --- /dev/null +++ b/juniper/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) 2016-2022, Magnus Hallin +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/juniper/Makefile.toml b/juniper/Makefile.toml deleted file mode 100644 index 6736f477..00000000 --- a/juniper/Makefile.toml +++ /dev/null @@ -1,30 +0,0 @@ -# This is needed as the release config is at a different path than the top-level -# release config. -[env] -CARGO_MAKE_CARGO_ALL_FEATURES = "" - -[tasks.release] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--execute", "${RELEASE_LEVEL}"] - -[tasks.release-dry-run] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--no-confirm", "--no-publish", "--no-push", "--no-tag", "${RELEASE_LEVEL}"] - -[tasks.release-local-test] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--no-confirm", "${RELEASE_LEVEL}"] - -[tasks.test] -args = ["test", "--all-features"] -[tasks.test-custom] -args = ["test", "--all-features"] -[tasks.test-flow] -args = ["test", "--all-features"] -[tasks.test-multi-flow-phase] -args = ["test", "--all-features"] -[tasks.test-thread-safe] -args = ["test", "--all-features"] -[tasks.test-verbose] -args = ["test", "--all-features"] -[tasks.test-with-args] -args = ["test", "--all-features"] -[tasks.ci-coverage-flow] -args = ["test", "--all-features"] diff --git a/juniper/README.md b/juniper/README.md new file mode 100644 index 00000000..03b1ed8c --- /dev/null +++ b/juniper/README.md @@ -0,0 +1,105 @@ +Juniper (GraphQL server library for Rust) +========================================= + +[![Crates.io](https://img.shields.io/crates/v/juniper.svg?maxAge=2592000)](https://crates.io/crates/juniper) +[![Documentation](https://docs.rs/juniper/badge.svg)](https://docs.rs/juniper) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Juniper Book] ([current][Juniper Book] | [edge][Juniper Book edge]) +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper/CHANGELOG.md) + + +[GraphQL] is a data query language developed by [Facebook] and intended to serve mobile and web application frontends. + +*[Juniper]* makes it possible to write [GraphQL] servers in [Rust] that are type-safe and blazingly fast. We also try to make declaring and resolving [GraphQL] schemas as convenient as possible as [Rust] will allow. + +[Juniper] doesn't include a web server - instead it provides building blocks to make integration with existing servers straightforward, including embedded [GraphiQL] and/or [GraphQL Playground] for easy debugging. + + + + +## Getting Started + +The best place to get started is [Juniper Book], which contains guides with plenty of examples, covering all features of [Juniper]. + +To get started quickly and get a feel for Juniper, check out the ["Quickstart" section][1]. + +For specific information about macros, types and the [Juniper] API, the [API docs][Juniper] is the best place to look. + + + + +## Features + +[Juniper] supports the full [GraphQL] query language according to [October 2021 GraphQL specification](https://spec.graphql.org/October2021), including interfaces, unions, schema introspection, and validations. It does not, however, support the schema language. + +As an exception to other [GraphQL] libraries for other languages, [Juniper] builds non-`null` types by default. A field of type `Vec` will be converted into `[Episode!]!`. The corresponding Rust type for e.g. `[Episode]` would be `Option>>`. + + + + +## Integrations + + +### Data types + +[Juniper] has automatic integration with some very common [Rust] crates to make building schemas a breeze. The types from these crates will be usable in your schemas automatically: +- [`bson`] +- [`chrono`] (feature gated) +- [`chrono-tz`] (feature gated) +- [`time`] (feature gated) +- [`url`] +- [`uuid`] + + +### Web servers + +- [`actix-web`] ([`juniper_actix`] crate) +- [`hyper`] ([`juniper_hyper`] crate) +- [`iron`] ([`juniper_iron`] crate) +- [`rocket`] ([`juniper_rocket`] crate) +- [`warp`] ([`juniper_warp`] crate) + + + + +## API Stability + +[Juniper] has not reached 1.0 yet, thus some API instability should be expected. + + + + +## License + +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper/LICENSE). + + + + +[`actix-web`]: https://docs.rs/actix-web +[`bson`]: https://docs.rs/bson +[`chrono`]: https://docs.rs/chrono +[`chrono-tz`]: https://docs.rs/chrono-tz +[`juniper_actix`]: https://docs.rs/juniper_actix +[`juniper_hyper`]: https://docs.rs/juniper_hyper +[`juniper_iron`]: https://docs.rs/juniper_iron +[`juniper_rocket`]: https://docs.rs/juniper_rocket +[`juniper_warp`]: https://docs.rs/juniper_warp +[`hyper`]: https://docs.rs/hyper +[`iron`]: https://docs.rs/iron +[`rocket`]: https://docs.rs/rocket +[`time`]: https://docs.rs/time +[`url`]: https://docs.rs/url +[`uuid`]: https://docs.rs/uuid +[`warp`]: https://docs.rs/warp +[Facebook]: https://facebook.com +[GraphiQL]: https://github.com/graphql/graphiql +[GraphQL]: http://graphql.org +[GraphQL Playground]: https://github.com/graphql/graphql-playground +[Juniper]: https://docs.rs/juniper +[Juniper Book]: https://graphql-rust.github.io +[Juniper Book edge]: https://graphql-rust.github.io/juniper/master +[Rust]: https://www.rust-lang.org + +[1]: https://graphql-rust.github.io/quickstart.html diff --git a/juniper/release.toml b/juniper/release.toml index d3dea325..a8cc1d5f 100644 --- a/juniper/release.toml +++ b/juniper/release.toml @@ -1,33 +1,94 @@ -pre-release-commit-message = "Release {{crate_name}} {{version}}" -post-release-commit-message = "Bump {{crate_name}} version to {{next_version}}" -tag-message = "Release {{crate_name}} {{version}}" -pre-release-replacements = [ - # Juniper's changelog - {file="CHANGELOG.md", min=0, search="# master", replace="# master\n\n- No changes yet\n\n# [[{{version}}] {{date}}](https://github.com/graphql-rust/juniper/releases/tag/{{crate_name}}-v{{version}})"}, - {file="src/lib.rs", min=0, search="docs.rs/juniper/[a-z0-9\\.-]+", replace="docs.rs/juniper/{{version}}"}, - # docs - {file="../docs/book/content/quickstart.md", min=0, search="juniper = \"[^\"]+\"", replace="juniper = \"{{version}}\""}, - # codegen - {file="../juniper_codegen/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - # Tests. - {file="../integration_tests/juniper_tests/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - # Hyper - {file="../juniper_hyper/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - {file="../juniper_hyper/Cargo.toml", min=0, search="\\[dev-dependencies\\.juniper\\]\nversion = \"[^\"]+\"", replace="[dev-dependencies.juniper]\nversion = \"{{version}}\""}, - # Iron - {file="../juniper_iron/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - {file="../juniper_iron/Cargo.toml", min=0, search="\\[dev-dependencies\\.juniper\\]\nversion = \"[^\"]+\"", replace="[dev-dependencies.juniper]\nversion = \"{{version}}\""}, - # Rocket - {file="../juniper_rocket/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - {file="../juniper_rocket/Cargo.toml", min=0, search="\\[dev-dependencies\\.juniper\\]\nversion = \"[^\"]+\"", replace="[dev-dependencies.juniper]\nversion = \"{{version}}\""}, - # Warp - {file="../juniper_warp/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - {file="../juniper_warp/Cargo.toml", min=0, search="\\[dev-dependencies\\.juniper\\]\nversion = \"[^\"]+\"", replace="[dev-dependencies.juniper]\nversion = \"{{version}}\""}, - # Subscriptions - {file="../juniper_subscriptions/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - # GraphQL-WS - {file="../juniper_graphql_ws/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - # Actix-Web - {file="../juniper_actix/Cargo.toml", min=0, search="juniper = \\{ version = \"[^\"]+\"", replace="juniper = { version = \"{{version}}\""}, - {file="../juniper_actix/Cargo.toml", min=0, search="\\[dev-dependencies\\.juniper\\]\nversion = \"[^\"]+\"", replace="[dev-dependencies.juniper]\nversion = \"{{version}}\""}, -] +[[pre-release-replacements]] +file = "../book/src/advanced/dataloaders.md" +exactly = 1 +search = "juniper = \"[^\"]+\"" +replace = "juniper = \"{{version}}\"" +[[pre-release-replacements]] +file = "../book/src/advanced/subscriptions.md" +exactly = 1 +search = "juniper = \"[^\"]+\"" +replace = "juniper = \"{{version}}\"" +[[pre-release-replacements]] +file = "../book/src/quickstart.md" +exactly = 1 +search = "juniper = \"[^\"]+\"" +replace = "juniper = \"{{version}}\"" +[[pre-release-replacements]] +file = "../book/src/servers/hyper.md" +exactly = 1 +search = "juniper = \"[^\"]+\"" +replace = "juniper = \"{{version}}\"" +[[pre-release-replacements]] +file = "../book/src/servers/iron.md" +exactly = 1 +search = "juniper = \"[^\"]+\"" +replace = "juniper = \"{{version}}\"" +[[pre-release-replacements]] +file = "../book/src/servers/rocket.md" +exactly = 1 +search = "juniper = \"[^\"]+\"" +replace = "juniper = \"{{version}}\"" +[[pre-release-replacements]] +file = "../book/src/servers/warp.md" +exactly = 1 +search = "juniper = \"[^\"]+\"" +replace = "juniper = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_actix/Cargo.toml" +exactly = 2 +search = "juniper = \\{ version = \"[^\"]+\"" +replace = "juniper = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_graphql_ws/Cargo.toml" +exactly = 1 +search = "juniper = \\{ version = \"[^\"]+\"" +replace = "juniper = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_hyper/Cargo.toml" +exactly = 2 +search = "juniper = \\{ version = \"[^\"]+\"" +replace = "juniper = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_iron/Cargo.toml" +exactly = 2 +search = "juniper = \\{ version = \"[^\"]+\"" +replace = "juniper = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_rocket/Cargo.toml" +exactly = 2 +search = "juniper = \\{ version = \"[^\"]+\"" +replace = "juniper = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_subscriptions/Cargo.toml" +exactly = 1 +search = "juniper = \\{ version = \"[^\"]+\"" +replace = "juniper = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_warp/Cargo.toml" +exactly = 2 +search = "juniper = \\{ version = \"[^\"]+\"" +replace = "juniper = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "...master\\)" +replace = "...{{crate_name}}%40{{version}})" + +[[pre-release-replacements]] +file = "README.md" +exactly = 2 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs index 81720618..d864cd10 100644 --- a/juniper/src/lib.rs +++ b/juniper/src/lib.rs @@ -1,106 +1,11 @@ -/*! - -# GraphQL - -[GraphQL][graphql] is a data query language developed by Facebook intended to -serve mobile and web application frontends. - -*Juniper* makes it possible to write GraphQL servers in Rust that are -type-safe and blazingly fast. We also try to make declaring and resolving -GraphQL schemas as convenient as possible as Rust will allow. - -Juniper does not include a web server - instead it provides building blocks to -make integration with existing servers straightforward. It optionally provides a -pre-built integration for the [Iron][iron] and [Rocket] frameworks, including -embedded [Graphiql][graphiql] for easy debugging. - -* [Cargo crate](https://crates.io/crates/juniper) -* [API Reference][docsrs] -* [Book][book]: Guides and Examples - - -## Getting Started - -The best place to get started is the [Juniper Book][book], which contains -guides with plenty of examples, covering all features of Juniper. - -To get started quickly and get a feel for Juniper, check out the -[Quickstart][book_quickstart] section. - -For specific information about macros, types and the Juniper api, the -[API Reference][docsrs] is the best place to look. - -You can also check out [src/tests/schema.rs][test_schema_rs] to see a complex -schema including polymorphism with traits and interfaces. -For an example of web framework integration, -see the [rocket][rocket_examples] and [iron][iron_examples] examples folders. - - -## Features - -Juniper supports the full GraphQL query language according to the -[specification][graphql_spec], including interfaces, unions, schema -introspection, and validations. -It does not, however, support the schema language. - -As an exception to other GraphQL libraries for other languages, Juniper builds -non-null types by default. A field of type `Vec` will be converted into -`[Episode!]!`. The corresponding Rust type for e.g. `[Episode]` would be -`Option>>`. - -## Integrations - -### Data types - -Juniper has automatic integration with some very common Rust crates to make -building schemas a breeze. The types from these crates will be usable in -your Schemas automatically. - -* [uuid][uuid] -* [url][url] -* [chrono][chrono] -* [chrono-tz][chrono-tz] -* [time][time] -* [bson][bson] - -### Web Frameworks - -* [rocket][rocket] -* [iron][iron] - - -## API Stability - -Juniper has not reached 1.0 yet, thus some API instability should be expected. - -[graphql]: http://graphql.org -[graphiql]: https://github.com/graphql/graphiql -[iron]: https://github.com/iron/iron -[graphql_spec]: http://facebook.github.io/graphql -[test_schema_rs]: https://github.com/graphql-rust/juniper/blob/master/juniper/src/tests/schema.rs -[tokio]: https://github.com/tokio-rs/tokio -[rocket_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_rocket/examples -[iron_examples]: https://github.com/graphql-rust/juniper/tree/master/juniper_iron/examples -[Rocket]: https://rocket.rs -[book]: https://graphql-rust.github.io/ -[book_quickstart]: https://graphql-rust.github.io/quickstart.html -[docsrs]: https://docs.rs/juniper - -[uuid]: https://crates.io/crates/uuid -[url]: https://crates.io/crates/url -[chrono]: https://crates.io/crates/chrono -[chrono-tz]: https://crates.io/crates/chrono-tz -[time]: https://crates.io/crates/time -[bson]: https://crates.io/crates/bson - -*/ +#![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_cfg))] // Due to `schema_introspection` test. #![cfg_attr(test, recursion_limit = "256")] -#![doc(html_root_url = "https://docs.rs/juniper/0.15.9")] #![warn(missing_docs)] -// Required for using `juniper_codegen` macros inside this crate to resolve absolute `::juniper` -// path correctly, without errors. +// Required for using `juniper_codegen` macros inside this crate to resolve +// absolute `::juniper` path correctly, without errors. extern crate self as juniper; use std::fmt; diff --git a/juniper/src/schema/meta.rs b/juniper/src/schema/meta.rs index ccd43a99..2ba1faa4 100644 --- a/juniper/src/schema/meta.rs +++ b/juniper/src/schema/meta.rs @@ -50,10 +50,16 @@ pub struct ScalarMeta<'a, S> { pub description: Option, #[doc(hidden)] pub specified_by_url: Option>, - pub(crate) try_parse_fn: for<'b> fn(&'b InputValue) -> Result<(), FieldError>, - pub(crate) parse_fn: for<'b> fn(ScalarToken<'b>) -> Result>, + pub(crate) try_parse_fn: InputValueParseFn, + pub(crate) parse_fn: ScalarTokenParseFn, } +/// Shortcut for an [`InputValue`] parsing function. +pub type InputValueParseFn = for<'b> fn(&'b InputValue) -> Result<(), FieldError>; + +/// Shortcut for a [`ScalarToken`] parsing function. +pub type ScalarTokenParseFn = for<'b> fn(ScalarToken<'b>) -> Result>; + /// List type metadata #[derive(Debug)] pub struct ListMeta<'a> { @@ -92,7 +98,7 @@ pub struct EnumMeta<'a, S> { pub description: Option, #[doc(hidden)] pub values: Vec, - pub(crate) try_parse_fn: for<'b> fn(&'b InputValue) -> Result<(), FieldError>, + pub(crate) try_parse_fn: InputValueParseFn, } /// Interface type metadata @@ -125,7 +131,7 @@ pub struct InputObjectMeta<'a, S> { pub description: Option, #[doc(hidden)] pub input_fields: Vec>, - pub(crate) try_parse_fn: for<'b> fn(&'b InputValue) -> Result<(), FieldError>, + pub(crate) try_parse_fn: InputValueParseFn, } /// A placeholder for not-yet-registered types @@ -342,9 +348,7 @@ impl<'a, S> MetaType<'a, S> { /// `true` if it can be parsed as the provided type. /// /// Only scalars, enums, and input objects have parse functions. - pub fn input_value_parse_fn( - &self, - ) -> Option fn(&'b InputValue) -> Result<(), FieldError>> { + pub fn input_value_parse_fn(&self) -> Option> { match *self { MetaType::Scalar(ScalarMeta { ref try_parse_fn, .. diff --git a/juniper/src/schema/model.rs b/juniper/src/schema/model.rs index 0576174e..5544fbbd 100644 --- a/juniper/src/schema/model.rs +++ b/juniper/src/schema/model.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, fmt}; use fnv::FnvHashMap; -#[cfg(feature = "graphql-parser-integration")] +#[cfg(feature = "graphql-parser")] use graphql_parser::schema::Document; use crate::{ @@ -13,7 +13,7 @@ use crate::{ GraphQLEnum, }; -#[cfg(feature = "graphql-parser-integration")] +#[cfg(feature = "graphql-parser")] use crate::schema::translate::{graphql_parser::GraphQLParserTranslator, SchemaTranslator}; /// Root query node of a schema @@ -171,7 +171,7 @@ where format!("{}", doc) } - #[cfg(feature = "graphql-parser-integration")] + #[cfg(feature = "graphql-parser")] /// The schema definition as a [`graphql_parser`](https://crates.io/crates/graphql-parser) /// [`Document`](https://docs.rs/graphql-parser/latest/graphql_parser/schema/struct.Document.html). pub fn as_parser_document(&'a self) -> Document<'a, &'a str> { @@ -193,22 +193,17 @@ impl<'a, S> SchemaType<'a, S> { SubscriptionT: GraphQLType, { let mut directives = FnvHashMap::default(); - let query_type_name: String; - let mutation_type_name: String; - let subscription_type_name: String; - let mut registry = Registry::new(FnvHashMap::default()); - query_type_name = registry + + let query_type_name = registry .get_type::(query_info) .innermost_name() .to_owned(); - - mutation_type_name = registry + let mutation_type_name = registry .get_type::(mutation_info) .innermost_name() .to_owned(); - - subscription_type_name = registry + let subscription_type_name = registry .get_type::(subscription_info) .innermost_name() .to_owned(); @@ -619,7 +614,7 @@ impl<'a, S> fmt::Display for TypeType<'a, S> { #[cfg(test)] mod test { - #[cfg(feature = "graphql-parser-integration")] + #[cfg(feature = "graphql-parser")] mod graphql_parser_integration { use crate::{graphql_object, EmptyMutation, EmptySubscription, RootNode}; diff --git a/juniper/src/schema/translate/mod.rs b/juniper/src/schema/translate/mod.rs index 2408af63..06121850 100644 --- a/juniper/src/schema/translate/mod.rs +++ b/juniper/src/schema/translate/mod.rs @@ -4,5 +4,5 @@ pub trait SchemaTranslator<'a, T> { fn translate_schema(s: &'a SchemaType) -> T; } -#[cfg(feature = "graphql-parser-integration")] +#[cfg(feature = "graphql-parser")] pub mod graphql_parser; diff --git a/juniper_actix/.gitignore b/juniper_actix/.gitignore deleted file mode 100644 index 0d722487..00000000 --- a/juniper_actix/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/target -/examples/**/target/**/* -**/*.rs.bk -Cargo.lock diff --git a/juniper_actix/CHANGELOG.md b/juniper_actix/CHANGELOG.md index ff493864..d403d4da 100644 --- a/juniper_actix/CHANGELOG.md +++ b/juniper_actix/CHANGELOG.md @@ -1,34 +1,32 @@ -# master +`juniper_actix` changelog +========================= -- Compatibility with the latest `juniper`. +All user visible changes to `juniper_actix` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. -# [[0.4.0] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper_actix-0.4.0) -- Require `actix-web` >= `4.0.0-beta8`. -- Compatibility with the latest `juniper`. -# [[0.2.5] 2021-06-07](https://github.com/graphql-rust/juniper/releases/tag/juniper_actix-0.2.5) -- Compatibility with the latest `juniper`. +## master -# [[0.2.4] 2021-04-03](https://github.com/graphql-rust/juniper/releases/tag/juniper_actix-0.2.4) +### BC Breaks -- Compatibility with the latest `juniper`. +- Switched to 4.0 version of [`actix-web` crate] and its ecosystem. ([#1034]) +- Switched to 0.16 version of [`juniper` crate]. +- Switched to 0.4 version of [`juniper_graphql_ws` crate]. -# [[0.2.3] 2021-01-27](https://github.com/graphql-rust/juniper/releases/tag/juniper_actix-0.2.3) +[#1034]: /../../pull/1034 -- Compatibility with the latest `juniper`. -- Fix Content-Type charset parsing ([#863](https://github.com/graphql-rust/juniper/pull/863)) -# [[0.2.2] 2021-01-15](https://github.com/graphql-rust/juniper/releases/tag/juniper_actix-0.2.2) -- Compatibility with the latest `juniper`. -# [[0.2.1] 2020-12-12](https://github.com/graphql-rust/juniper/releases/tag/juniper_actix-0.2.1) +## Previous releases -- Actix package updated to 3.3. +See [old CHANGELOG](/../../blob/juniper_actix-v0.4.0/juniper_actix/CHANGELOG.md). -# [[0.2.0] 2020-12-09](https://github.com/graphql-rust/juniper/releases/tag/juniper_actix-0.2.0) -- Actix package updated to 3.0.0 -- Subscription support -- Initial Release + + + +[`actix-web` crate]: https://docs.rs/actix-web +[`juniper` crate]: https://docs.rs/juniper +[`juniper_graphql_ws` crate]: https://docs.rs/juniper_graphql_ws +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper_actix/Cargo.toml b/juniper_actix/Cargo.toml index f805eb73..f46a7498 100644 --- a/juniper_actix/Cargo.toml +++ b/juniper_actix/Cargo.toml @@ -1,12 +1,21 @@ [package] name = "juniper_actix" -version = "0.5.0" +version = "0.5.0-dev" edition = "2018" -authors = ["Jordao Rosario "] -description = "Juniper GraphQL integration with Actix" +description = "`juniper` GraphQL integration with `actix-web`." license = "BSD-2-Clause" +authors = ["Jordao Rosario "] documentation = "https://docs.rs/juniper_actix" +homepage = "https://github.com/graphql-rust/juniper/tree/master/juniper_actix" repository = "https://github.com/graphql-rust/juniper" +readme = "README.md" +categories = ["asynchronous", "web-programming", "web-programming::http-server"] +keywords = ["actix-web", "apollo", "graphql", "juniper", "websocket"] +exclude = ["/examples/", "/release.toml"] + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] [features] subscriptions = ["juniper_graphql_ws", "tokio"] @@ -14,30 +23,26 @@ subscriptions = ["juniper_graphql_ws", "tokio"] [dependencies] actix = "0.13" actix-http = "3.0" -http = "0.2.4" actix-web = "4.0" actix-web-actors = "4.1.0" - -juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } -juniper_graphql_ws = { version = "0.3.0", path = "../juniper_graphql_ws", optional = true } - anyhow = "1.0" futures = "0.3" +juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } +juniper_graphql_ws = { version = "0.4.0-dev", path = "../juniper_graphql_ws", optional = true } +http = "0.2.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" tokio = { version = "1.0", features = ["sync"], optional = true } [dev-dependencies] -actix-rt = "2" actix-cors = "0.6" actix-identity = "0.4" -tokio = "1.0" -async-stream = "0.3" +actix-rt = "2.0" actix-test = "=0.1.0-beta.13" - -juniper = { version = "0.16.0-dev", path = "../juniper", features = ["expose-test-schema"] } - +async-stream = "0.3" bytes = "1.0" env_logger = "0.9" +juniper = { version = "0.16.0-dev", path = "../juniper", features = ["expose-test-schema"] } log = "0.4" +tokio = "1.0" diff --git a/juniper_actix/LICENSE b/juniper_actix/LICENSE index 6771d89f..3acbe949 100644 --- a/juniper_actix/LICENSE +++ b/juniper_actix/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2018, Jordao Rosario +Copyright (c) 2018-2022, Jordao Rosario All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/juniper_actix/Makefile.toml b/juniper_actix/Makefile.toml deleted file mode 100644 index 66adc0a2..00000000 --- a/juniper_actix/Makefile.toml +++ /dev/null @@ -1,16 +0,0 @@ -[tasks.test] -args = ["test", "--all-features"] -[tasks.test-custom] -args = ["test", "--all-features"] -[tasks.test-flow] -args = ["test", "--all-features"] -[tasks.test-multi-flow-phase] -args = ["test", "--all-features"] -[tasks.test-thread-safe] -args = ["test", "--all-features"] -[tasks.test-verbose] -args = ["test", "--all-features"] -[tasks.test-with-args] -args = ["test", "--all-features"] -[tasks.ci-coverage-flow] -args = ["test", "--all-features"] diff --git a/juniper_actix/README.md b/juniper_actix/README.md index 5f52cb98..833685d0 100644 --- a/juniper_actix/README.md +++ b/juniper_actix/README.md @@ -1,34 +1,49 @@ -# juniper_actix +`juniper_actix` crate +===================== + +[![Crates.io](https://img.shields.io/crates/v/juniper_actix.svg?maxAge=2592000)](https://crates.io/crates/juniper_actix) +[![Documentation](https://docs.rs/juniper_actix/badge.svg)](https://docs.rs/juniper_actix) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper_actix/CHANGELOG.md) + +[`actix-web`] web server integration for [`juniper`] ([GraphQL] implementation for [Rust]). + +It's inspired and some parts are copied from [`juniper_warp`] crate. + + -This repository contains the [actix][actix] web server integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust, its inspired and some parts are copied from [juniper_warp][juniper_warp]. ## Documentation -For documentation, including guides and examples, check out [Juniper][Juniper]. +For documentation, including guides and examples, check out [Juniper Book]. + +A basic usage example can also be found in the [API docs][`juniper_actix`]. + + -A basic usage example can also be found in the [API documentation][documentation]. ## Examples -Check [examples/actix_server][example] for example code of a working actix -server with GraphQL handlers. +Check [`examples/actix_server.rs`][1] for example code of a working [`actix-web`] server with [GraphQL] handlers. + -## Links -* [Juniper][Juniper] -* [API Reference][documentation] -* [actix][actix] ## License -This project is under the BSD-2 license. +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper_actix/LICENSE). -Check the LICENSE file for details. -[actix]: https://github.com/actix/actix-web -[Juniper]: https://github.com/graphql-rust/juniper + + +[`actix-web`]: https://docs.rs/actix-web +[`juniper`]: https://docs.rs/juniper +[`juniper_actix`]: https://docs.rs/juniper_actix +[`juniper_warp`]: https://docs.rs/juniper_warp [GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_actix -[example]: https://github.com/graphql-rust/juniper/blob/master/juniper_actix/examples/actix_server.rs -[juniper_warp]:https://docs.rs/juniper_warp \ No newline at end of file +[Juniper Book]: https://graphql-rust.github.io +[Rust]: https://www.rust-lang.org + +[1]: https://github.com/graphql-rust/juniper/blob/master/juniper_actix/examples/actix_server.rs + diff --git a/juniper_actix/release.toml b/juniper_actix/release.toml new file mode 100644 index 00000000..4806c63e --- /dev/null +++ b/juniper_actix/release.toml @@ -0,0 +1,11 @@ +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" + +[[pre-release-replacements]] +file = "README.md" +exactly = 3 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper_actix/src/lib.rs b/juniper_actix/src/lib.rs index 935be89c..c88c1b00 100644 --- a/juniper_actix/src/lib.rs +++ b/juniper_actix/src/lib.rs @@ -1,44 +1,7 @@ -/*! - -# juniper_actix - -This repository contains the [actix][actix] web server integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust, its inspired and some parts are copied from [juniper_warp][juniper_warp] - -## Documentation - -For documentation, including guides and examples, check out [Juniper][Juniper]. - -A basic usage example can also be found in the [API documentation][documentation]. - -## Examples - -Check [examples/actix_server][example] for example code of a working actix -server with GraphQL handlers. - -## Links - -* [Juniper][Juniper] -* [API Reference][documentation] -* [actix][actix] - -## License - -This project is under the BSD-2 license. - -Check the LICENSE file for details. - -[actix]: https://github.com/actix/actix-web -[Juniper]: https://github.com/graphql-rust/juniper -[GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_actix -[example]: https://github.com/graphql-rust/juniper/blob/master/juniper_actix/examples/actix_server.rs -[juniper_warp]: https://github.com/graphql-rust/juniper/juniper_warp -*/ - +#![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_cfg))] #![deny(missing_docs)] #![deny(warnings)] -#![doc(html_root_url = "https://docs.rs/juniper_actix/0.1.0")] use actix_web::{ error::JsonPayloadError, http::Method, web, Error, FromRequest, HttpMessage, HttpRequest, diff --git a/juniper_benchmarks/.gitignore b/juniper_benchmarks/.gitignore deleted file mode 100644 index 69369904..00000000 --- a/juniper_benchmarks/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target -**/*.rs.bk -Cargo.lock diff --git a/juniper_benchmarks/CHANGELOG.md b/juniper_benchmarks/CHANGELOG.md deleted file mode 100644 index e69de29b..00000000 diff --git a/juniper_benchmarks/Makefile.toml b/juniper_benchmarks/Makefile.toml deleted file mode 100644 index c1f8c331..00000000 --- a/juniper_benchmarks/Makefile.toml +++ /dev/null @@ -1,12 +0,0 @@ -[tasks.release] -disabled = true -[tasks.release-some] -disabled = true -[tasks.release-local-test] -disabled = true -[tasks.release-some-local-test] -disabled = true -[tasks.release-dry-run] -disabled = true -[tasks.release-some-dry-run] -disabled = true diff --git a/juniper_codegen/CHANGELOG.md b/juniper_codegen/CHANGELOG.md new file mode 100644 index 00000000..9afc8143 --- /dev/null +++ b/juniper_codegen/CHANGELOG.md @@ -0,0 +1,55 @@ +`juniper_codegen` changelog +=========================== + +All user visible changes to `juniper_codegen` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. + + + + +## master + +### BC Breaks + +- `#[graphql_object]` and `#[graphql_subscription]` expansions now preserve defined `impl` blocks "as is" and reuse defined methods in opaque way. ([#971]) +- Renamed `rename = ""` attribute argument to `rename_all = ""` (following `serde` style). ([#971]) +- Redesigned `#[graphql_interface]` macro: ([#1009]) + - Removed support for `dyn` attribute argument (interface values as trait objects). + - Removed support for `downcast` attribute argument (custom resolution into implementer types). + - Removed support for `async` trait methods (not required anymore). + - Removed necessity of writing `impl Trait for Type` blocks (interfaces are implemented just by matching their fields now). + - Forbade default implementations of non-ignored trait methods. + - Supported coercion of additional `null`able arguments and return sub-typing on implementer. + - Supported `rename_all = ""` attribute argument influencing all its fields and their arguments. ([#971]) +- Split `#[derive(GraphQLScalarValue)]` macro into: + - `#[derive(GraphQLScalar)]` for implementing GraphQL scalar: ([#1017]) + - Supported generic `ScalarValue`. + - Supported structs with single named field. + - Supported overriding resolvers with external functions, methods or modules. + - Supported `specified_by_url` attribute argument. ([#1003], [#1000]) + - `#[derive(ScalarValue)]` for implementing `ScalarValue` trait: ([#1025]) + - Removed `Serialize` implementation (now should be provided explicitly). ([#985]) +- Redesigned `#[graphql_scalar]` macro: ([#1014]) + - Changed `from_input_value()` return type from `Option` to `Result`. ([#987]) + - Mirrored new `#[derive(GraphQLScalar)]` macro. + - Supported usage on type aliases in case `#[derive(GraphQLScalar)]` isn't applicable because of [orphan rules]. + +### Added + +- `#[derive(GraphQLInterface)]` macro allowing using structs as GraphQL interfaces. ([#1026]) + +[#971]: /../../pull/971 +[#985]: /../../pull/985 +[#987]: /../../pull/987 +[#1000]: /../../issues/1000 +[#1003]: /../../pull/1003 +[#1009]: /../../pull/1009 +[#1014]: /../../pull/1014 +[#1017]: /../../pull/1017 +[#1025]: /../../pull/1025 +[#1026]: /../../pull/1026 + + + + +[orphan rules]: https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper_codegen/Cargo.toml b/juniper_codegen/Cargo.toml index 92fbb492..79ba4d63 100644 --- a/juniper_codegen/Cargo.toml +++ b/juniper_codegen/Cargo.toml @@ -2,17 +2,20 @@ name = "juniper_codegen" version = "0.16.0-dev" edition = "2018" +description = "Code generation for `juniper` crate." +license = "BSD-2-Clause" authors = [ "Magnus Hallin ", "Christoph Herzog ", + "Ilya Solovyiov ", + "Kai Ren ", ] -description = "Internal custom derive trait for Juniper GraphQL" -license = "BSD-2-Clause" -documentation = "https://docs.rs/juniper" +documentation = "https://docs.rs/juniper-codegen" +homepage = "https://github.com/graphql-rust/juniper/tree/master/juniper_codegen" repository = "https://github.com/graphql-rust/juniper" - -[badges] -travis-ci = { repository = "graphql-rust/juniper" } +readme = "README.md" +keywords = ["codegen", "graphql", "juniper", "macros"] +exclude = ["/release.toml"] [lib] proc-macro = true @@ -27,5 +30,5 @@ url = "2.0" [dev-dependencies] derive_more = "0.99.7" futures = "0.3" -juniper = { version = "0.16.0-dev", path = "../juniper" } +juniper = { path = "../juniper" } serde = "1.0" diff --git a/juniper_codegen/LICENSE b/juniper_codegen/LICENSE new file mode 100644 index 00000000..f1c4508b --- /dev/null +++ b/juniper_codegen/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) 2016-2022, Magnus Hallin +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/juniper_codegen/Makefile.toml b/juniper_codegen/Makefile.toml deleted file mode 100644 index 58aa74fb..00000000 --- a/juniper_codegen/Makefile.toml +++ /dev/null @@ -1,11 +0,0 @@ -# This is needed as the release config is at a different path than the top-level -# release config. - -[tasks.release] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--execute", "${RELEASE_LEVEL}"] - -[tasks.release-dry-run] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--no-confirm", "--no-publish", "--no-push", "--no-tag", "${RELEASE_LEVEL}"] - -[tasks.release-local-test] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--no-confirm", "${RELEASE_LEVEL}"] diff --git a/juniper_codegen/README.md b/juniper_codegen/README.md new file mode 100644 index 00000000..9ccfd60a --- /dev/null +++ b/juniper_codegen/README.md @@ -0,0 +1,24 @@ +`juniper_codegen` crate +======================= + +[![Crates.io](https://img.shields.io/crates/v/juniper_codegen.svg?maxAge=2592000)](https://crates.io/crates/juniper_codegen) +[![Documentation](https://docs.rs/juniper_codegen/badge.svg)](https://docs.rs/juniper_codegen) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper_codegen/CHANGELOG.md) + +Code generation for [`juniper`] crate. + +DO NOT use it directly, use [`juniper`] crate instead. + + + + +## License + +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper_codegen/LICENSE). + + + + +[`juniper`]: https://docs.rs/juniper diff --git a/juniper_codegen/release.toml b/juniper_codegen/release.toml index 33a9caec..b8548dbf 100644 --- a/juniper_codegen/release.toml +++ b/juniper_codegen/release.toml @@ -1,7 +1,17 @@ -pre-release-commit-message = "Release {{crate_name}} {{version}}" -post-release-commit-message = "Bump {{crate_name}} version to {{next_version}}" -tag-message = "Release {{crate_name}} {{version}}" -pre-release-replacements = [ - {file="../juniper/Cargo.toml", min=0, search="juniper_codegen = \\{ version = \"[^\"]+\"", replace="juniper_codegen = { version = \"{{version}}\""}, - {file="src/lib.rs", min=0, search="docs.rs/juniper_codegen/[a-z0-9\\.-]+", replace="docs.rs/juniper_codegen/{{version}}"}, -] +[[pre-release-replacements]] +file = "../juniper/Cargo.toml" +exactly = 1 +search = "juniper_codegen = \\{ version = \"[^\"]+\"" +replace = "{{crate_name}} = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" + +[[pre-release-replacements]] +file = "README.md" +exactly = 2 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper_codegen/src/common/field/arg.rs b/juniper_codegen/src/common/field/arg.rs index fdd8f648..9eeb72cf 100644 --- a/juniper_codegen/src/common/field/arg.rs +++ b/juniper_codegen/src/common/field/arg.rs @@ -261,13 +261,13 @@ pub(crate) enum OnMethod { /// Regular [GraphQL field argument][1]. /// /// [1]: https://spec.graphql.org/June2018/#sec-Language.Arguments - Regular(OnField), + Regular(Box), /// [`Context`] passed into a [GraphQL field][2] resolving method. /// /// [`Context`]: juniper::Context /// [2]: https://spec.graphql.org/June2018/#sec-Language.Fields - Context(syn::Type), + Context(Box), /// [`Executor`] passed into a [GraphQL field][2] resolving method. /// @@ -281,7 +281,7 @@ impl OnMethod { #[must_use] pub(crate) fn as_regular(&self) -> Option<&OnField> { if let Self::Regular(arg) = self { - Some(arg) + Some(&*arg) } else { None } @@ -292,7 +292,7 @@ impl OnMethod { #[must_use] pub(crate) fn context_ty(&self) -> Option<&syn::Type> { if let Self::Context(ty) = self { - Some(ty) + Some(&*ty) } else { None } @@ -411,7 +411,7 @@ impl OnMethod { .ok()?; if attr.context.is_some() { - return Some(Self::Context(argument.ty.unreferenced().clone())); + return Some(Self::Context(Box::new(argument.ty.unreferenced().clone()))); } if attr.executor.is_some() { return Some(Self::Executor); @@ -419,7 +419,7 @@ impl OnMethod { if let syn::Pat::Ident(name) = &*argument.pat { let arg = match name.ident.unraw().to_string().as_str() { "context" | "ctx" | "_context" | "_ctx" => { - Some(Self::Context(argument.ty.unreferenced().clone())) + Some(Self::Context(Box::new(argument.ty.unreferenced().clone()))) } "executor" | "_executor" => Some(Self::Executor), _ => None, @@ -459,11 +459,11 @@ impl OnMethod { return None; } - Some(Self::Regular(OnField { + Some(Self::Regular(Box::new(OnField { name, ty: argument.ty.as_ref().clone(), description: attr.description.as_ref().map(|d| d.as_ref().value()), default: attr.default.as_ref().map(|v| v.as_ref().clone()), - })) + }))) } } diff --git a/juniper_codegen/src/lib.rs b/juniper_codegen/src/lib.rs index 052ca188..1c7da4db 100644 --- a/juniper_codegen/src/lib.rs +++ b/juniper_codegen/src/lib.rs @@ -1,10 +1,4 @@ -//! This crate supplies custom derive implementations for the -//! [juniper](https://github.com/graphql-rust/juniper) crate. -//! -//! You should not depend on juniper_codegen directly. -//! You only need the `juniper` crate. - -#![doc(html_root_url = "https://docs.rs/juniper_codegen/0.15.9")] +#![doc = include_str!("../README.md")] #![recursion_limit = "1024"] mod result; diff --git a/juniper_graphql_ws/CHANGELOG.md b/juniper_graphql_ws/CHANGELOG.md index 2d283d01..a375a5bf 100644 --- a/juniper_graphql_ws/CHANGELOG.md +++ b/juniper_graphql_ws/CHANGELOG.md @@ -1,8 +1,28 @@ -# master +`juniper_graphql_ws` changelog +============================== -- Compatibility with the latest `juniper`. +All user visible changes to `juniper_graphql_ws` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. -# [[0.2.0] 2020-12-09](https://github.com/graphql-rust/juniper/releases/tag/juniper_graphql_ws-0.2.0) -- Fix null deserialization issue ([#735](https://github.com/graphql-rust/juniper/issues/735)) -- Initial Release + + +## master + +### BC Breaks + +- Switched to 0.16 version of [`juniper` crate]. +- Switched to 0.17 version of [`juniper_subscriptions` crate]. + + + + +## Previous releases + +See [old CHANGELOG](/../../blob/juniper_graphql_ws-v0.3.0/juniper_graphql_ws/CHANGELOG.md). + + + + +[`juniper` crate]: https://docs.rs/juniper +[`juniper_subscriptions` crate]: https://docs.rs/juniper_subscriptions +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper_graphql_ws/Cargo.toml b/juniper_graphql_ws/Cargo.toml index f0906244..3b74f4bb 100644 --- a/juniper_graphql_ws/Cargo.toml +++ b/juniper_graphql_ws/Cargo.toml @@ -1,19 +1,23 @@ [package] name = "juniper_graphql_ws" -version = "0.3.0" +version = "0.4.0-dev" edition = "2018" -authors = ["Christopher Brown "] +description = "GraphQL over WebSocket Protocol implementation for `juniper` crate." license = "BSD-2-Clause" -description = "GraphQL over WebSocket protocol implementation for Juniper" +authors = ["Christopher Brown "] documentation = "https://docs.rs/juniper_graphql_ws" +homepage = "https://github.com/graphql-rust/juniper/tree/master/juniper_graphql_ws" repository = "https://github.com/graphql-rust/juniper" -keywords = ["apollo", "graphql", "graphql-ws", "juniper"] +readme = "README.md" +categories = ["asynchronous", "web-programming", "web-programming::http-server"] +keywords = ["apollo", "graphql", "graphql-ws", "subscription", "websocket"] +exclude = ["/release.toml"] [dependencies] juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } -juniper_subscriptions = { version = "0.16.0", path = "../juniper_subscriptions" } +juniper_subscriptions = { version = "0.17.0-dev", path = "../juniper_subscriptions" } serde = { version = "1.0.8", features = ["derive"], default-features = false } -tokio = { version = "1", features = ["macros", "rt", "time"], default-features = false } +tokio = { version = "1.0", features = ["macros", "rt", "time"], default-features = false } [dev-dependencies] serde_json = "1.0" diff --git a/juniper_graphql_ws/LICENSE b/juniper_graphql_ws/LICENSE new file mode 100644 index 00000000..652dd95d --- /dev/null +++ b/juniper_graphql_ws/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) 2018-2022, Christopher Brown +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/juniper_graphql_ws/Makefile.toml b/juniper_graphql_ws/Makefile.toml deleted file mode 100644 index 8a804aba..00000000 --- a/juniper_graphql_ws/Makefile.toml +++ /dev/null @@ -1,33 +0,0 @@ -# This is needed as the release config is at a different path than the top-level -# release config. - -[tasks.release] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--execute", "${RELEASE_LEVEL}"] - -[tasks.release-dry-run] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--no-confirm", "--no-publish", "--no-push", "--no-tag", "${RELEASE_LEVEL}"] - -[tasks.release-local-test] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--no-confirm", "${RELEASE_LEVEL}"] - - -[env] -CARGO_MAKE_CARGO_ALL_FEATURES = "" - -[tasks.build-verbose] -condition = { rust_version = { min = "1.29.0" } } - -[tasks.build-verbose.windows] -condition = { rust_version = { min = "1.29.0" }, env = { "TARGET" = "x86_64-pc-windows-msvc" } } - -[tasks.test-verbose] -condition = { rust_version = { min = "1.29.0" } } - -[tasks.test-verbose.windows] -condition = { rust_version = { min = "1.29.0" }, env = { "TARGET" = "x86_64-pc-windows-msvc" } } - -[tasks.ci-coverage-flow] -condition = { rust_version = { min = "1.29.0" } } - -[tasks.ci-coverage-flow.windows] -disabled = true diff --git a/juniper_graphql_ws/README.md b/juniper_graphql_ws/README.md new file mode 100644 index 00000000..b3f18e1c --- /dev/null +++ b/juniper_graphql_ws/README.md @@ -0,0 +1,24 @@ +`juniper_graphql_ws` crate +========================== + +[![Crates.io](https://img.shields.io/crates/v/juniper_graphql_ws.svg?maxAge=2592000)](https://crates.io/crates/juniper_graphql_ws) +[![Documentation](https://docs.rs/juniper_graphql_ws/badge.svg)](https://docs.rs/juniper_graphql_ws) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper_graphql_ws/CHANGELOG.md) + +This crate contains an implementation of the [GraphQL over WebSocket Protocol][1], as used by [Apollo]. + + + + +## License + +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper_graphql_ws/LICENSE). + + + + +[Apollo]: https://www.apollographql.com + +[1]: https://github.com/apollographql/subscriptions-transport-ws/blob/0ce7a1e1eb687fe51214483e4735f50a2f2d5c79/PROTOCOL.md diff --git a/juniper_graphql_ws/release.toml b/juniper_graphql_ws/release.toml index a7356262..8c424022 100644 --- a/juniper_graphql_ws/release.toml +++ b/juniper_graphql_ws/release.toml @@ -1,8 +1,23 @@ -pre-release-commit-message = "Release {{crate_name}} {{version}}" -post-release-commit-message = "Bump {{crate_name}} version to {{next_version}}" -tag-message = "Release {{crate_name}} {{version}}" -pre-release-replacements = [ - {file="src/lib.rs", min=0, search="docs.rs/juniper_graphql_ws/[a-z0-9\\.-]+", replace="docs.rs/juniper_graphql_ws/{{version}}"}, -{file="../juniper_warp/Cargo.toml", min=0, search="juniper_graphql_ws = \\{ version = \"[^\"]+\"", replace="juniper_graphql_ws = { version = \"{{version}}\""}, -{file="../juniper_actix/Cargo.toml", min=0, search="juniper_graphql_ws = \\{ version = \"[^\"]+\"", replace="juniper_graphql_ws = { version = \"{{version}}\""}, -] +[[pre-release-replacements]] +file = "../juniper_actix/Cargo.toml" +exactly = 1 +search = "juniper_graphql_ws = \\{ version = \"[^\"]+\"" +replace = "juniper_graphql_ws = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_warp/Cargo.toml" +exactly = 1 +search = "juniper_graphql_ws = \\{ version = \"[^\"]+\"" +replace = "juniper_graphql_ws = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" + +[[pre-release-replacements]] +file = "README.md" +exactly = 2 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper_graphql_ws/src/lib.rs b/juniper_graphql_ws/src/lib.rs index 51c2e914..cfb8b967 100644 --- a/juniper_graphql_ws/src/lib.rs +++ b/juniper_graphql_ws/src/lib.rs @@ -1,11 +1,4 @@ -/*! - -# juniper_graphql_ws - -This crate contains an implementation of the [graphql-ws protocol](https://github.com/apollographql/subscriptions-transport-ws/blob/263844b5c1a850c1e29814564eb62cb587e5eaaf/PROTOCOL.md), as used by Apollo. - -*/ - +#![doc = include_str!("../README.md")] #![deny(missing_docs)] #![deny(warnings)] diff --git a/juniper_hyper/.gitignore b/juniper_hyper/.gitignore deleted file mode 100644 index a9d37c56..00000000 --- a/juniper_hyper/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -target -Cargo.lock diff --git a/juniper_hyper/CHANGELOG.md b/juniper_hyper/CHANGELOG.md index 890990cd..e0e722ea 100644 --- a/juniper_hyper/CHANGELOG.md +++ b/juniper_hyper/CHANGELOG.md @@ -1,78 +1,26 @@ -# master +`juniper_hyper` changelog +========================= -- Compatibility with the latest `juniper`. +All user visible changes to `juniper_hyper` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. -# [[0.8.0] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.8.0) -- Compatibility with the latest `juniper`. -# [[0.7.3] 2022-02-02](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-v0.7.3) -- Compatibility with the latest `juniper`. +## master -# [[0.7.2] 2022-01-26](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-v0.7.2) +### BC Breaks -- Compatibility with the latest `juniper`. +- Switched to 0.16 version of [`juniper` crate]. -# [[0.7.1] 2021-06-07](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.7.1) -- Compatibility with the latest `juniper`. -# [[0.7.0] 2021-04-03](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.7.0) -- **[Breaking change]** Remove unneccesary `Result`s ([#889](https://github.com/graphql-rust/juniper/pull/889)) +## Previous releases -# [[0.6.3] 2021-01-27](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.6.3) +See [old CHANGELOG](/../../blob/juniper_hyper-v0.8.0/juniper_hyper/CHANGELOG.md). -- Compatibility with the latest `juniper`. -# [[0.6.2] 2021-01-15](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.6.2) -- Compatibility with the latest `juniper`. -# [[0.6.1] 2020-12-12](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.6.1) - -- Compatibility with the latest `juniper`. - -# [[0.6.0] 2020-12-09](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.6.0) - -- Compatibility with the latest `juniper`. - -## Breaking Changes - -- `juniper_hyper::graphiql` now requires a second parameter for subscriptions. -- `juniper_hyper::graphql` now executes the schema asynchronously. For blocking synchronous execution consider `juniper_hyper::graphql_sync` for use. -- `400 Bad Request` is now returned if POST HTTP request contains no or invalid `Content-Type` header. - -# [[0.5.2] 2019-12-16](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.5.2) - -- Compatibility with the latest `juniper`. - -# [[0.5.1] 2019-10-24](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.5.1) - -- Compatibility with the latest `juniper`. - -# [[0.5.0] 2019-09-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.5.0) - -- Compatibility with the latest `juniper`. - -# [[0.4.1] 2019-07-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.4.1) - -- Compatibility with the latest `juniper`. - -# [[0.4.0] 2019-07-19](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.4.0) - -- Compatibility with the latest `juniper`. - -# [[0.3.0] 2019-05-16](https://github.com/graphql-rust/juniper/releases/tag/juniper_hyper-0.3.0) - -- Compatibility with the latest `juniper`. - -# 0.2.0 [2018-12-18] - -## Breaking changes - -- The tokio threadpool managed by `hyper` is now used for - executing GraphQL operations as well. Previously a separate threadpool from `futures_cpupool` was required. - - [#256](https://github.com/graphql-rust/juniper/pull/256) +[`juniper` crate]: https://docs.rs/juniper +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper_hyper/Cargo.toml b/juniper_hyper/Cargo.toml index 97ba5d0a..72ab1f4f 100644 --- a/juniper_hyper/Cargo.toml +++ b/juniper_hyper/Cargo.toml @@ -1,17 +1,22 @@ [package] name = "juniper_hyper" -version = "0.8.0" +version = "0.9.0-dev" edition = "2018" -authors = ["Damir Vandic "] -description = "Juniper GraphQL integration with Hyper" +description = "`juniper` GraphQL integration with `hyper`." license = "BSD-2-Clause" +authors = ["Damir Vandic "] documentation = "https://docs.rs/juniper_hyper" +homepage = "https://github.com/graphql-rust/juniper/tree/master/juniper_hyper" repository = "https://github.com/graphql-rust/juniper" +readme = "README.md" +categories = ["asynchronous", "web-programming", "web-programming::http-server"] +keywords = ["apollo", "graphql", "hyper", "juniper"] +exclude = ["/examples/", "/release.toml"] [dependencies] futures = "0.3.1" -juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } hyper = { version = "0.14", features = ["server", "runtime"] } +juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } serde_json = "1.0" tokio = "1.0" url = "2.0" diff --git a/juniper_hyper/LICENSE b/juniper_hyper/LICENSE index 3f82bd0b..eeac3a20 100644 --- a/juniper_hyper/LICENSE +++ b/juniper_hyper/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2018, Damir Vandic +Copyright (c) 2018-2022, Damir Vandic All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/juniper_hyper/README.md b/juniper_hyper/README.md index f42ebc3c..3d9d5d10 100644 --- a/juniper_hyper/README.md +++ b/juniper_hyper/README.md @@ -1,35 +1,45 @@ -# juniper_hyper +`juniper_hyper` crate +===================== + +[![Crates.io](https://img.shields.io/crates/v/juniper_hyper.svg?maxAge=2592000)](https://crates.io/crates/juniper_hyper) +[![Documentation](https://docs.rs/juniper_hyper/badge.svg)](https://docs.rs/juniper_hyper) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper_hyper/CHANGELOG.md) + +[`hyper`] web server integration for [`juniper`] ([GraphQL] implementation for [Rust]). + + -This repository contains the [Hyper][Hyper] web server integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust. ## Documentation -For documentation, including guides and examples, check out [Juniper][Juniper]. +For documentation, including guides and examples, check out [Juniper Book]. + +A basic usage example can also be found in the [API docs][`juniper_hyper`]. + + -A basic usage example can also be found in the [API documentation][documentation]. ## Examples -Check [examples/hyper_server.rs][example] for example code of a working Hyper -server with GraphQL handlers. +Check [`examples/hyper_server.rs`][1] for example code of a working [`hyper`] server with [GraphQL] handlers. + -## Links -* [Juniper][Juniper] -* [API documentation][documentation] -* [Hyper][Hyper] ## License -This project is under the BSD-2 license. +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper_hyper/LICENSE). -Check the LICENSE file for details. -[Hyper]: https://hyper.rs -[Juniper]: https://github.com/graphql-rust/juniper + + +[`hyper`]: https://docs.rs/hyper +[`juniper`]: https://docs.rs/juniper +[`juniper_hyper`]: https://docs.rs/juniper_hyper [GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_hyper -[example]: https://github.com/graphql-rust/juniper/blob/master/juniper_hyper/examples/hyper_server.rs - +[Juniper Book]: https://graphql-rust.github.io +[Rust]: https://www.rust-lang.org +[1]: https://github.com/graphql-rust/juniper/blob/master/juniper_hyper/examples/hyper_server.rs diff --git a/juniper_hyper/release.toml b/juniper_hyper/release.toml new file mode 100644 index 00000000..4818936d --- /dev/null +++ b/juniper_hyper/release.toml @@ -0,0 +1,17 @@ +[[pre-release-replacements]] +file = "../book/src/servers/hyper.md" +exactly = 1 +search = "juniper_hyper = \"[^\"]+\"" +replace = "juniper_hyper = \"{{version}}\"" + +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" + +[[pre-release-replacements]] +file = "README.md" +exactly = 3 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper_hyper/src/lib.rs b/juniper_hyper/src/lib.rs index d46df452..ce9204eb 100644 --- a/juniper_hyper/src/lib.rs +++ b/juniper_hyper/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/juniper_hyper/0.2.0")] +#![doc = include_str!("../README.md")] use std::{error::Error, fmt, string::FromUtf8Error, sync::Arc}; diff --git a/juniper_iron/.gitignore b/juniper_iron/.gitignore deleted file mode 100644 index a9d37c56..00000000 --- a/juniper_iron/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -target -Cargo.lock diff --git a/juniper_iron/CHANGELOG.md b/juniper_iron/CHANGELOG.md index 3938f03e..467e1568 100644 --- a/juniper_iron/CHANGELOG.md +++ b/juniper_iron/CHANGELOG.md @@ -1,76 +1,26 @@ -# master +`juniper_iron` changelog +======================== -- Compatibility with the latest `juniper`. +All user visible changes to `juniper_iron` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. -# [[0.7.6] 2022-02-02](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-v0.7.6) -- Compatibility with the latest `juniper`. -# [[0.7.5] 2022-01-26](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-v0.7.5) -- Compatibility with the latest `juniper`. +## master -# [[0.7.4] 2021-06-07](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.7.4) +### BC Breaks -- Compatibility with the latest `juniper`. +- Switched to 0.16 version of [`juniper` crate]. -# [[0.7.3] 2021-04-03](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.7.3) -- Compatibility with the latest `juniper`. -# [[0.7.2] 2021-01-27](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.7.2) -- Compatibility with the latest `juniper`. +## Previous releases -# [[0.7.1] 2021-01-15](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.7.1) +See [old CHANGELOG](/../../blob/juniper_iron-v0.7.6/juniper_iron/CHANGELOG.md). -- Compatibility with the latest `juniper`. -# [[0.7.0] 2020-12-09](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.7.0) -- Compatibility with the latest `juniper`. -## Breaking Changes - -- `juniper_iron::GraphiQLHandler::new` now requires a second parameter for subscriptions. -- `400 Bad Request` is now returned if POST HTTP request contains no or invalid `Content-Type` header. - -# [[0.6.2] 2019-12-16](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.6.2) - -- Compatibility with the latest `juniper`. - -# [[0.6.1] 2019-10-24](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.6.1) - -- Compatibility with the latest `juniper`. - -# [[0.6.0] 2019-09-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.6.0) - -- Compatibility with the latest `juniper`. - -# [[0.5.1] 2019-07-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.5.1) - -- Compatibility with the latest `juniper`. - -# [[0.5.0] 2019-07-19](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.5.0) - -- Compatibility with the latest `juniper`. - -# [[0.4.0] 2019-05-16](https://github.com/graphql-rust/juniper/releases/tag/juniper_iron-0.4.0) - -- Compatibility with the latest `juniper`. - -# [0.3.0] 2018-12-17 - -- Compatibility with the latest `juniper`. - -## [0.2.0] - 2018-09-13 - -### Changed - -- (**breaking**) `context_factory` now returns `IronResult` instead of `Context`. - -## [0.1.2] - 2018-02-10 - -### Changed - -- Extend iron support to 0.6 +[`juniper` crate]: https://docs.rs/juniper +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper_iron/Cargo.toml b/juniper_iron/Cargo.toml index 831d7599..d4b4b759 100644 --- a/juniper_iron/Cargo.toml +++ b/juniper_iron/Cargo.toml @@ -1,28 +1,33 @@ [package] name = "juniper_iron" -version = "0.7.6" +version = "0.8.0-dev" edition = "2018" +description = "`juniper` GraphQL integration with `iron`." +license = "BSD-2-Clause" authors = [ "Magnus Hallin ", "Christoph Herzog ", ] -description = "Iron integration for juniper" -license = "BSD-2-Clause" documentation = "https://docs.rs/juniper_iron" +homepage = "https://github.com/graphql-rust/juniper/tree/master/juniper_iron" repository = "https://github.com/graphql-rust/juniper" +readme = "README.md" +categories = ["web-programming", "web-programming::http-server"] +keywords = ["apollo", "graphql", "iron", "juniper"] +exclude = ["/examples/", "/release.toml"] [dependencies] futures = "0.3.1" -juniper = { version = "0.16.0-dev", path = "../juniper" } iron = ">= 0.5, < 0.7" +juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } serde_json = "1.0.2" urlencoded = ">= 0.5, < 0.7" [dev-dependencies] -juniper = { version = "0.16.0-dev", path = "../juniper", features = ["expose-test-schema"] } iron-test = "0.6" +juniper = { version = "0.16.0-dev", path = "../juniper", features = ["expose-test-schema"] } logger = "0.4" mount = "0.4" -percent-encoding = "2" +percent-encoding = "2.0" router = "0.6" -url = "2" +url = "2.0" diff --git a/juniper_iron/LICENSE b/juniper_iron/LICENSE index 0ccd1e17..f1c4508b 100644 --- a/juniper_iron/LICENSE +++ b/juniper_iron/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2016, Magnus Hallin +Copyright (c) 2016-2022, Magnus Hallin All rights reserved. Redistribution and use in source and binary forms, with or without @@ -22,4 +22,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/juniper_iron/README.md b/juniper_iron/README.md index 18b42a78..a1eaeae0 100644 --- a/juniper_iron/README.md +++ b/juniper_iron/README.md @@ -1,31 +1,45 @@ -# juniper_iron +`juniper_iron` crate +==================== + +[![Crates.io](https://img.shields.io/crates/v/juniper_iron.svg?maxAge=2592000)](https://crates.io/crates/juniper_iron) +[![Documentation](https://docs.rs/juniper_iron/badge.svg)](https://docs.rs/juniper_iron) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper_iron/CHANGELOG.md) + +[`iron`] web framework integration for [`juniper`] ([GraphQL] implementation for [Rust]). + + + + +## Documentation + +For documentation, including guides and examples, check out [Juniper Book]. + +A basic usage example can also be found in the [API docs][`juniper_iron`]. -This repository contains the [Iron][Iron] web framework integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust. -For documentation, including guides and examples, check out [Juniper][Juniper]. -A basic usage example can also be found in the [Api documentation][documentation]. ## Examples -Check [examples/iron_server.rs][example] for example code of a working Iron server with GraphQL handlers. +Check [`examples/iron_server.rs`][1] for example code of a working [`iron`] server with [GraphQL] handlers. + -## Links -* [Juniper][Juniper] -* [Api Reference][documetation] -* [Iron framework][Iron] ## License -This project is under the BSD-2 license. +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper_iron/LICENSE). -Check the LICENSE file for details. -[Iron]: https://github.com/iron/iron -[Juniper]: https://github.com/graphql-rust/juniper + + +[`iron`]: https://docs.rs/iron +[`juniper`]: https://docs.rs/juniper +[`juniper_iron`]: https://docs.rs/juniper_iron [GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_iron -[example]: https://github.com/graphql-rust/juniper/blob/master/juniper_iron/examples/iron_server.rs +[Juniper Book]: https://graphql-rust.github.io +[Rust]: https://www.rust-lang.org +[1]: https://github.com/graphql-rust/juniper/blob/master/juniper_iron/examples/iron_server.rs diff --git a/juniper_iron/release.toml b/juniper_iron/release.toml new file mode 100644 index 00000000..bbbf30d6 --- /dev/null +++ b/juniper_iron/release.toml @@ -0,0 +1,17 @@ +[[pre-release-replacements]] +file = "../book/src/servers/iron.md" +exactly = 1 +search = "juniper_iron = \"[^\"]+\"" +replace = "juniper_iron = \"{{version}}\"" + +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" + +[[pre-release-replacements]] +file = "README.md" +exactly = 3 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper_iron/src/lib.rs b/juniper_iron/src/lib.rs index cbef5ace..6e104ea0 100644 --- a/juniper_iron/src/lib.rs +++ b/juniper_iron/src/lib.rs @@ -1,110 +1,4 @@ -/*! - -# juniper_iron - -This repository contains the [Iron][Iron] web framework integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust. - -For documentation, including guides and examples, check out [Juniper][Juniper]. - -A basic usage example can also be found in the [Api documentation][documentation]. - -## Links - -* [Juniper][Juniper] -* [Api Reference][documentation] -* [Iron framework][Iron] - -## Integrating with Iron - - -For example, continuing from the schema created above and using Iron to expose -the schema on an HTTP endpoint supporting both GET and POST requests: - -```rust,no_run -# use std::collections::HashMap; -# -use iron::prelude::*; -use juniper_iron::GraphQLHandler; -use juniper::{Context, EmptyMutation, EmptySubscription}; -# -# use juniper::FieldResult; -# -# struct User { id: String, name: String, friend_ids: Vec } -# struct QueryRoot; -# struct Database { users: HashMap } -# -# #[juniper::graphql_object(context = Database)] -# impl User { -# fn id(&self) -> FieldResult<&String> { -# Ok(&self.id) -# } -# -# fn name(&self) -> FieldResult<&String> { -# Ok(&self.name) -# } -# -# fn friends<'c>(&self, context: &'c Database) -> FieldResult> { -# Ok(self.friend_ids.iter() -# .filter_map(|id| context.users.get(id)) -# .collect()) -# } -# } -# -# #[juniper::graphql_object(context = Database, scalar = juniper::DefaultScalarValue)] -# impl QueryRoot { -# fn user(context: &Database, id: String) -> FieldResult> { -# Ok(context.users.get(&id)) -# } -# } - -// This function is executed for every request. Here, we would realistically -// provide a database connection or similar. For this example, we'll be -// creating the database from scratch. -fn context_factory(_: &mut Request) -> IronResult { - Ok(Database { - users: vec![ - ( "1000".to_owned(), User { - id: "1000".to_owned(), name: "Robin".to_owned(), - friend_ids: vec!["1001".to_owned()] } ), - ( "1001".to_owned(), User { - id: "1001".to_owned(), name: "Max".to_owned(), - friend_ids: vec!["1000".to_owned()] } ), - ].into_iter().collect() - }) -} - -impl Context for Database {} - -fn main() { - // GraphQLHandler takes a context factory function, the root object, - // and the mutation object. If we don't have any mutations to expose, we - // can use the empty tuple () to indicate absence. - let graphql_endpoint = GraphQLHandler::new( - context_factory, - QueryRoot, - EmptyMutation::::new(), - EmptySubscription::::new(), - ); - - // Start serving the schema at the root on port 8080. - Iron::new(graphql_endpoint).http("localhost:8080").unwrap(); -} - -``` - -See the the [`GraphQLHandler`][3] documentation for more information on what request methods are -supported. - -[3]: ./struct.GraphQLHandler.html -[Iron]: https://github.com/iron/iron -[Juniper]: https://github.com/graphql-rust/juniper -[GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_iron - -*/ - -#![doc(html_root_url = "https://docs.rs/juniper_iron/0.3.0")] +#![doc = include_str!("../README.md")] use std::{error::Error, fmt, io::Read, ops::Deref as _}; diff --git a/juniper_rocket/.gitignore b/juniper_rocket/.gitignore deleted file mode 100644 index a9d37c56..00000000 --- a/juniper_rocket/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -target -Cargo.lock diff --git a/juniper_rocket/CHANGELOG.md b/juniper_rocket/CHANGELOG.md index f130f231..64a4faf7 100644 --- a/juniper_rocket/CHANGELOG.md +++ b/juniper_rocket/CHANGELOG.md @@ -1,106 +1,33 @@ -# master +`juniper_rocket` changelog +========================== -- Compatibility with the latest `juniper`. -- Provide `AsRef` and `AsMut` implementation for `GraphQLRequest` to its inner type ([#968](https://github.com/graphql-rust/juniper/pull/968), [#930](https://github.com/graphql-rust/juniper/issues/930)). -- Ability to set custom request body size limit ([#1044](https://github.com/graphql-rust/juniper/pull/1044)). +All user visible changes to `juniper_rocket` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. -# [[0.8.1] 2022-03-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-v0.8.1) -- Ability to set custom request body size limit ([#1044](https://github.com/graphql-rust/juniper/pull/1044)). -# [[0.8.0] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-v0.8.0) -- Require async rocket support (`rocket` >= 0.5-rc1). -- Compatibility with the latest `juniper`. +## master -# [[0.7.1] 2021-06-07](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.7.1) +### BC Breaks -- Compatibility with the latest `juniper`. +- Switched to 0.16 version of [`juniper` crate]. -# [[0.7.0] 2021-06-07](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.7.0) +### Added -- Minimum `rocket` version is now `0.4.9`. Note this also bumps the [minimum required `rustc` version](https://github.com/SergioBenitez/Rocket/blob/v0.4/CHANGELOG.md#version-048-may-18-2021). -- Compatibility with the latest `juniper`. +- `AsRef` and `AsMut` implementation for `GraphQLRequest` to its inner type. ([#968], [#930]) -# [[0.6.3] 2021-04-03](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.6.3) +[#930]: /../../issues/930 +[#968]: /../../pull/968 -- Compatibility with the latest `juniper`. -# [[0.6.2] 2021-01-27](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.6.2) -- Compatibility with the latest `juniper`. -# [[0.6.1] 2021-01-15](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.6.1) +## Previous releases -- Compatibility with the latest `juniper`. +See [old CHANGELOG](/../../blob/juniper_rocket-v0.8.1/juniper_rocket/CHANGELOG.md). -# [[0.6.0] 2020-12-09](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.6.0) -- Compatibility with the latest `juniper`. -- Rocket integration does not require default features. -- Support `application/graphql` POST requests. -## Breaking Changes -- `juniper_rocket::graphiql_source` now requires a second parameter for subscriptions - -# [[0.5.2] 2019-12-16](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.5.2) - -- Compatibility with the latest `juniper`. - -# [[0.5.1] 2019-10-24](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.5.1) - -- Compatibility with the latest `juniper`. - -# [[0.5.0] 2019-09-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.5.0) - -- Compatibility with the latest `juniper`. - -# [[0.4.1] 2019-07-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.4.1) - -- Compatibility with the latest `juniper`. - -# [[0.4.0] 2019-07-19](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.4.0) - -- Compatibility with the latest `juniper`. - -# [[0.3.0] 2019-05-16](https://github.com/graphql-rust/juniper/releases/tag/juniper_rocket-0.3.0) - -- Expose the operation names from `GraphQLRequest`. -- Compatibility with the latest `juniper`. - -# [0.2.0] 2018-12-17 - -### Rocket updated to v0.4 - -[Rocket](https://rocket.rs) integration now requires Rocket `0.4.0`. This is due -to changes with the way Rocket handles form parsing. Before this update, it was -impossible to leverage Rocket integration with Rocket beyond 0.3.x. - -Check out [Rocket's Changelog](https://github.com/SergioBenitez/Rocket/blob/v0.4/CHANGELOG.md) -for more details on the 0.4 release. - -# juniper_rocket [0.1.3] 2018-09-13 - -- Add `juniper-0.10.0` compatibility. - -# juniper_rocket [0.1.2] 2018-01-13 - -## Changes - -### Rocket updated to `0.3.6` - -[Rocket](https://rocket.rs) integration now requires Rocket `0.3.6` to -support building with recent Rust nightlies. - -Additional information and supported nightly versions can be found in [Rocket's changelog](https://github.com/SergioBenitez/Rocket/blob/master/CHANGELOG.md#version-036-jan-12-2018). - -[#125](https://github.com/graphql-rust/juniper/issues/125) - -### Decoding of query params - -When processing GET requests, query parameters were not properly url_decoded, - -This was fixed by [PR #122](https://github.com/graphql-rust/juniper/pull/128) by @LegNeato. - -This fixed the [issue #116](https://github.com/graphql-rust/juniper/issues/116). +[`juniper` crate]: https://docs.rs/juniper +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper_rocket/Cargo.toml b/juniper_rocket/Cargo.toml index bf0a9eee..a8fdf409 100644 --- a/juniper_rocket/Cargo.toml +++ b/juniper_rocket/Cargo.toml @@ -1,15 +1,20 @@ [package] name = "juniper_rocket" -version = "0.8.1" +version = "0.9.0-dev" edition = "2018" +description = "`juniper` GraphQL integration with `rocket`." +license = "BSD-2-Clause" authors = [ "Magnus Hallin ", "Christoph Herzog ", ] -description = "Juniper GraphQL integration with Rocket" -license = "BSD-2-Clause" documentation = "https://docs.rs/juniper_rocket" +homepage = "https://github.com/graphql-rust/juniper/tree/master/juniper_rocket" repository = "https://github.com/graphql-rust/juniper" +readme = "README.md" +categories = ["asynchronous", "web-programming", "web-programming::http-server"] +keywords = ["apollo", "graphql", "juniper", "rocket"] +exclude = ["/examples/", "/tests/", "/release.toml"] [dependencies] futures = "0.3.1" diff --git a/juniper_rocket/LICENSE b/juniper_rocket/LICENSE index 0ccd1e17..f1c4508b 100644 --- a/juniper_rocket/LICENSE +++ b/juniper_rocket/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2016, Magnus Hallin +Copyright (c) 2016-2022, Magnus Hallin All rights reserved. Redistribution and use in source and binary forms, with or without @@ -22,4 +22,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/juniper_rocket/README.md b/juniper_rocket/README.md index 9ff6f6e2..651e3a5d 100644 --- a/juniper_rocket/README.md +++ b/juniper_rocket/README.md @@ -1,35 +1,45 @@ -# juniper_rocket +`juniper_rocket` crate +====================== + +[![Crates.io](https://img.shields.io/crates/v/juniper_rocket.svg?maxAge=2592000)](https://crates.io/crates/juniper_rocket) +[![Documentation](https://docs.rs/juniper_rocket/badge.svg)](https://docs.rs/juniper_rocket) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper_rocket/CHANGELOG.md) + +[`rocket`] web server integration for [`juniper`] ([GraphQL] implementation for [Rust]). + + -This repository contains the [Rocket][Rocket] web server integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust. ## Documentation -For documentation, including guides and examples, check out [Juniper][Juniper]. +For documentation, including guides and examples, check out [Juniper Book]. + +A basic usage example can also be found in the [API docs][`juniper_rocket`]. + + -A basic usage example can also be found in the [Api documentation][documentation]. ## Examples -Check [examples/rocket_server.rs][example] for example code of a working Rocket -server with GraphQL handlers. +Check [`examples/rocket_server.rs`][1] for example code of a working [`rocket`] server with [GraphQL] handlers. + -## Links -* [Juniper][Juniper] -* [Api Reference][documetation] -* [Rocket][Iron] ## License -This project is under the BSD-2 license. +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper_rocket/LICENSE). -Check the LICENSE file for details. -[Rocket]: https://rocket.rs -[Juniper]: https://github.com/graphql-rust/juniper + + +[`juniper`]: https://docs.rs/juniper +[`juniper_rocket`]: https://docs.rs/juniper_rocket +[`rocket`]: https://docs.rs/rocket [GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_rocket -[example]: https://github.com/graphql-rust/juniper/blob/master/juniper_rocket/examples/rocket_server.rs - +[Juniper Book]: https://graphql-rust.github.io +[Rust]: https://www.rust-lang.org +[1]: https://github.com/graphql-rust/juniper/blob/master/juniper_rocket/examples/rocket_server.rs diff --git a/juniper_rocket/release.toml b/juniper_rocket/release.toml new file mode 100644 index 00000000..4b548081 --- /dev/null +++ b/juniper_rocket/release.toml @@ -0,0 +1,17 @@ +[[pre-release-replacements]] +file = "../book/src/servers/rocket.md" +exactly = 1 +search = "juniper_rocket = \"[^\"]+\"" +replace = "juniper_rocket = \"{{version}}\"" + +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" + +[[pre-release-replacements]] +file = "README.md" +exactly = 3 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper_rocket/src/lib.rs b/juniper_rocket/src/lib.rs index e972233b..6cc1bf85 100644 --- a/juniper_rocket/src/lib.rs +++ b/juniper_rocket/src/lib.rs @@ -1,42 +1,4 @@ -/*! - -# juniper_rocket - -This repository contains the [Rocket][Rocket] web server integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust. - -## Documentation - -For documentation, including guides and examples, check out [Juniper][Juniper]. - -A basic usage example can also be found in the [Api documentation][documentation]. - -## Examples - -Check [examples/rocket_server.rs][example] for example code of a working Rocket -server with GraphQL handlers. - -## Links - -* [Juniper][Juniper] -* [Api Reference][documentation] -* [Rocket][Rocket] - -## License - -This project is under the BSD-2 license. - -Check the LICENSE file for details. - -[Rocket]: https://rocket.rs -[Juniper]: https://github.com/graphql-rust/juniper -[GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_rocket -[example]: https://github.com/graphql-rust/juniper_rocket/blob/master/examples/rocket_server.rs - -*/ - -#![doc(html_root_url = "https://docs.rs/juniper_rocket/0.7.1")] +#![doc = include_str!("../README.md")] use std::{borrow::Cow, io::Cursor}; @@ -349,7 +311,10 @@ where }; Box::pin(async move { - let limit = req.limits().get("graphql").unwrap_or(BODY_LIMIT.bytes()); + let limit = req + .limits() + .get("graphql") + .unwrap_or_else(|| BODY_LIMIT.bytes()); let mut reader = data.open(limit); let mut body = String::new(); if let Err(e) = reader.read_to_string(&mut body).await { diff --git a/juniper_subscriptions/.gitignore b/juniper_subscriptions/.gitignore deleted file mode 100644 index 0d722487..00000000 --- a/juniper_subscriptions/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/target -/examples/**/target/**/* -**/*.rs.bk -Cargo.lock diff --git a/juniper_subscriptions/CHANGELOG.md b/juniper_subscriptions/CHANGELOG.md index e5789c84..b6ba2205 100644 --- a/juniper_subscriptions/CHANGELOG.md +++ b/juniper_subscriptions/CHANGELOG.md @@ -1,7 +1,26 @@ -# master +`juniper_subscriptions` changelog +================================= -- Compatibility with the latest `juniper`. +All user visible changes to `juniper_subscriptions` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. -# [[0.15.0] 2020-12-09](https://github.com/graphql-rust/juniper/releases/tag/juniper_subscriptions-0.15.0) -- Initial Release + + +## master + +### BC Breaks + +- Switched to 0.16 version of [`juniper` crate]. + + + + +## Previous releases + +See [old CHANGELOG](/../../blob/juniper_subscriptions-v0.16.0/juniper_subscriptions/CHANGELOG.md). + + + + +[`juniper` crate]: https://docs.rs/juniper +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper_subscriptions/Cargo.toml b/juniper_subscriptions/Cargo.toml index d7cdf7b4..ddea6d98 100644 --- a/juniper_subscriptions/Cargo.toml +++ b/juniper_subscriptions/Cargo.toml @@ -1,12 +1,17 @@ [package] name = "juniper_subscriptions" -version = "0.16.0" +version = "0.17.0-dev" edition = "2018" -authors = ["nWacky "] -description = "Juniper SubscriptionCoordinator and SubscriptionConnection implementations" +description = "Juniper `SubscriptionCoordinator` and `SubscriptionConnection` implementations." license = "BSD-2-Clause" +authors = ["nWacky "] documentation = "https://docs.rs/juniper_subscriptions" +homepage = "https://github.com/graphql-rust/juniper/tree/master/juniper_subscriptions" repository = "https://github.com/graphql-rust/juniper" +readme = "README.md" +categories = ["asynchronous", "web-programming", "web-programming::http-server"] +keywords = ["graphql", "server", "subscription", "web", "websocket"] +exclude = ["/release.toml"] [dependencies] futures = "0.3.1" @@ -14,4 +19,4 @@ juniper = { version = "0.16.0-dev", path = "../juniper", default-features = fals [dev-dependencies] serde_json = "1.0" -tokio = { version = "1", features = ["macros", "rt"] } +tokio = { version = "1.0", features = ["macros", "rt"] } diff --git a/juniper_subscriptions/LICENSE b/juniper_subscriptions/LICENSE index 177ee843..9374ec2c 100644 --- a/juniper_subscriptions/LICENSE +++ b/juniper_subscriptions/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2018, Tom Houlé +Copyright (c) 2018-2022, Tom Houlé All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/juniper_subscriptions/Makefile.toml b/juniper_subscriptions/Makefile.toml deleted file mode 100644 index afbd4f96..00000000 --- a/juniper_subscriptions/Makefile.toml +++ /dev/null @@ -1,33 +0,0 @@ - -# This is needed as the release config is at a different path than the top-level -# release config. - -[tasks.release] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--execute", "${RELEASE_LEVEL}"] - -[tasks.release-dry-run] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--no-confirm", "--no-publish", "--no-push", "--no-tag", "${RELEASE_LEVEL}"] - -[tasks.release-local-test] -args = ["release", "--config", "${CARGO_MAKE_WORKING_DIRECTORY}/release.toml", "--no-confirm", "${RELEASE_LEVEL}"] - -[env] -CARGO_MAKE_CARGO_ALL_FEATURES = "" - -[tasks.build-verbose] -condition = { rust_version = { min = "1.29.0" } } - -[tasks.build-verbose.windows] -condition = { rust_version = { min = "1.29.0" }, env = { "TARGET" = "x86_64-pc-windows-msvc" } } - -[tasks.test-verbose] -condition = { rust_version = { min = "1.29.0" } } - -[tasks.test-verbose.windows] -condition = { rust_version = { min = "1.29.0" }, env = { "TARGET" = "x86_64-pc-windows-msvc" } } - -[tasks.ci-coverage-flow] -condition = { rust_version = { min = "1.29.0" } } - -[tasks.ci-coverage-flow.windows] -disabled = true diff --git a/juniper_subscriptions/README.md b/juniper_subscriptions/README.md index 4c8e6859..e04493a0 100644 --- a/juniper_subscriptions/README.md +++ b/juniper_subscriptions/README.md @@ -1,37 +1,45 @@ -# juniper_subscriptions +`juniper_subscriptions` crate +============================= + +[![Crates.io](https://img.shields.io/crates/v/juniper_subscriptions.svg?maxAge=2592000)](https://crates.io/crates/juniper_subscriptions) +[![Documentation](https://docs.rs/juniper_subscriptions/badge.svg)](https://docs.rs/juniper_subscriptions) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper_subscriptions/CHANGELOG.md) + +This repository contains `SubscriptionCoordinator` and `SubscriptionConnection` implementations for +[`juniper`], a [GraphQL] library for Rust. + +You need both this and [`juniper`] crate for usage. + + -This repository contains [SubscriptionCoordinator][SubscriptionCoordinator] and -[SubscriptionConnection][SubscriptionConnection] implementations for -[Juniper][Juniper], a [GraphQL][GraphQL] library for Rust. ## Documentation -For this crate's documentation, check out [API documentation][documentation]. +For this crate's documentation, check out [API docs](https://docs.rs/juniper_subscriptions). + +For `SubscriptionCoordinator` and `SubscriptionConnection` documentation, check out [`juniper` API docs][`juniper`]. + + -For `SubscriptionCoordinator` and `SubscriptionConnection` documentation, check -out [Juniper][Juniper]. ## Examples -Check [examples/warp_subscriptions][example] for example code of a working -[warp][warp] server with GraphQL subscription handlers. +Check [`examples/warp_subscriptions/`][1] for example code of a working [`warp`] server with [GraphQL] subscription handlers. + -## Links -* [Juniper][Juniper] -* [API Reference][documentation] -* [warp][warp] ## License -This project is under the BSD-2 license. +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper_subscriptions/LICENSE). -Check the LICENSE file for details. -[warp]: https://github.com/seanmonstar/warp -[Juniper]: https://github.com/graphql-rust/juniper -[SubscriptionCoordinator]: https://docs.rs/juniper/latest/juniper/trait.SubscriptionCoordinator.html -[SubscriptionConnection]: https://docs.rs/juniper/latest/juniper/trait.SubscriptionConnection.html + + +[`juniper`]: https://docs.rs/juniper +[`warp`]: https://docs.rs/warp [GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_subscriptions -[example]: https://github.com/graphql-rust/juniper/blob/master/examples/warp_subscriptions/src/main.rs + +[1]: https://github.com/graphql-rust/juniper/blob/master/examples/warp_subscriptions/src/main.rs diff --git a/juniper_subscriptions/release.toml b/juniper_subscriptions/release.toml index 4108f647..837f61ae 100644 --- a/juniper_subscriptions/release.toml +++ b/juniper_subscriptions/release.toml @@ -1,7 +1,23 @@ -pre-release-commit-message = "Release {{crate_name}} {{version}}" -post-release-commit-message = "Bump {{crate_name}} version to {{next_version}}" -tag-message = "Release {{crate_name}} {{version}}" -pre-release-replacements = [ - {file="../juniper_graphql_ws/Cargo.toml", min=0, search="juniper_subscriptions = \\{ version = \"[^\"]+\"", replace="juniper_subscriptions = { version = \"{{version}}\""}, - {file="src/lib.rs", min=0, search="docs.rs/juniper_subscriptions/[a-z0-9\\.-]+", replace="docs.rs/juniper_subscriptions/{{version}}"}, -] +[[pre-release-replacements]] +file = "../book/src/advanced/subscriptions.md" +exactly = 1 +search = "juniper_subscriptions = \"[^\"]+\"" +replace = "juniper_subscriptions = \"{{version}}\"" + +[[pre-release-replacements]] +file = "../juniper_graphql_ws/Cargo.toml" +exactly = 1 +search = "juniper_subscriptions = \\{ version = \"[^\"]+\"" +replace = "juniper_subscriptions = { version = \"{{version}}\"" + +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" + +[[pre-release-replacements]] +file = "README.md" +exactly = 3 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper_subscriptions/src/lib.rs b/juniper_subscriptions/src/lib.rs index e09e1127..df6c5fe7 100644 --- a/juniper_subscriptions/src/lib.rs +++ b/juniper_subscriptions/src/lib.rs @@ -1,15 +1,6 @@ -//! This crate supplies [`SubscriptionCoordinator`] and -//! [`SubscriptionConnection`] implementations for the -//! [juniper](https://github.com/graphql-rust/juniper) crate. -//! -//! You need both this and `juniper` crate. -//! -//! [`SubscriptionCoordinator`]: juniper::SubscriptionCoordinator -//! [`SubscriptionConnection`]: juniper::SubscriptionConnection - +#![doc = include_str!("../README.md")] #![deny(missing_docs)] #![deny(warnings)] -#![doc(html_root_url = "https://docs.rs/juniper_subscriptions/0.16.0")] use std::{ iter::FromIterator, diff --git a/juniper_warp/.gitignore b/juniper_warp/.gitignore deleted file mode 100644 index 0d722487..00000000 --- a/juniper_warp/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/target -/examples/**/target/**/* -**/*.rs.bk -Cargo.lock diff --git a/juniper_warp/CHANGELOG.md b/juniper_warp/CHANGELOG.md index 072d4c59..b33dfea7 100644 --- a/juniper_warp/CHANGELOG.md +++ b/juniper_warp/CHANGELOG.md @@ -1,83 +1,26 @@ -# master +`juniper_warp` changelog +======================== -- Compatibility with the latest `juniper`. +All user visible changes to `juniper_warp` crate will be documented in this file. This project uses [Semantic Versioning 2.0.0]. -# [[0.7.0] 2021-07-08](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.7.0) -- Compatibility with the latest `juniper`. -# [[0.6.5] 2022-01-26](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-v0.6.5) -- Compatibility with the latest `juniper`. +## master -# [[0.6.4] 2021-06-07](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.6.4) +### BC Breaks -- Compatibility with the latest `juniper`. +- Switched to 0.16 version of [`juniper` crate]. -# [[0.6.3] 2021-04-03](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.6.3) -- Compatibility with the latest `juniper`. -# [[0.6.2] 2021-01-27](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.6.2) -- Compatibility with the latest `juniper`. +## Previous releases -# [[0.6.1] 2021-01-15](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.6.1) +See [old CHANGELOG](/../../blob/juniper_warp-v0.7.0/juniper_warp/CHANGELOG.md). -- Compatibility with the latest `juniper`. -# [[0.6.0] 2020-12-09](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.6.0) -- Compatibility with the latest `juniper`. -- Changed the implementation place of GraphQLBatchRequest and GraphQLBatchResponse in `juniper_warp` -to `juniper` to be reused in other http integrations, since this implementation was private. -## Breaking Changes - -- Update `playground_filter` to support subscription endpoint URLs. -- Update `warp` to 0.2. -- Rename synchronous `execute` to `execute_sync`, add asynchronous `execute` -- `juniper_warp::graphiql_filter` now requires a second parameter for subscriptions. -- `make_graphql_filter` and `make_graphql_filter_sync` now ignore POST HTTP requests with no or invalid `Content-Type` header. - -# [[0.5.2] 2019-12-16](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.5.2) - -- Compatibility with the latest `juniper`. - -# [[0.5.1] 2019-10-24](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.5.1) - -- Compatibility with the latest `juniper`. - -# [[0.5.0] 2019-09-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.5.0) - -- Compatibility with the latest `juniper`. - -# [[0.4.1] 2019-07-29](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.4.1) - -- Compatibility with the latest `juniper`. - -# [[0.4.0] 2019-07-19](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.4.0) - -- Compatibility with the latest `juniper`. - -# [[0.3.0] 2019-05-16](https://github.com/graphql-rust/juniper/releases/tag/juniper_warp-0.3.0) - -- Compatibility with the latest `juniper`. - -# [0.2.0] 2018-12-17 - -- **[Breaking Change]** The minimum required `warp` version is now `0.1.8`. - - [#271](https://github.com/graphql-rust/juniper/pull/271) - -- **[Breaking Change]** The `graphql_handler` and `graphiql_handler` functions have been renamed to`graphql_filter` and `graphiql_filter` respectively. - - [#267](https://github.com/graphql-rust/juniper/pull/267) - -- **[Breaking Change]** A `CpuPool` from `futures_cpupool` is no longer used. Instead, `warp`'s underlying `tokio_threadpool` is leveraged. Because of this, `make_graphql_filter_with_thread_pool` is no longer necessary and has been removed. - - [#258](https://github.com/graphql-rust/juniper/pull/258) - -# juniper_warp [0.1] 2018-09-13 - -- Initial Release +[`juniper` crate]: https://docs.rs/juniper +[Semantic Versioning 2.0.0]: https://semver.org diff --git a/juniper_warp/Cargo.toml b/juniper_warp/Cargo.toml index 0950be37..b49e379d 100644 --- a/juniper_warp/Cargo.toml +++ b/juniper_warp/Cargo.toml @@ -1,12 +1,21 @@ [package] name = "juniper_warp" -version = "0.7.0" +version = "0.8.0-dev" edition = "2018" -authors = ["Tom Houlé "] -description = "Juniper GraphQL integration with Warp" +description = "`juniper` GraphQL integration with `warp`." license = "BSD-2-Clause" +authors = ["Tom Houlé "] documentation = "https://docs.rs/juniper_warp" +homepage = "https://github.com/graphql-rust/juniper/tree/master/juniper_warp" repository = "https://github.com/graphql-rust/juniper" +readme = "README.md" +categories = ["asynchronous", "web-programming", "web-programming::http-server"] +keywords = ["apollo", "graphql", "juniper", "warp", "websocket"] +exclude = ["/examples/", "/release.toml"] + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] [features] subscriptions = ["juniper_graphql_ws"] @@ -15,11 +24,11 @@ subscriptions = ["juniper_graphql_ws"] anyhow = "1.0" futures = "0.3.1" juniper = { version = "0.16.0-dev", path = "../juniper", default-features = false } -juniper_graphql_ws = { version = "0.3.0", path = "../juniper_graphql_ws", optional = true } +juniper_graphql_ws = { version = "0.4.0-dev", path = "../juniper_graphql_ws", optional = true } serde = { version = "1.0.75", features = ["derive"] } serde_json = "1.0.24" thiserror = "1.0" -tokio = { version = "1", features = ["rt-multi-thread"] } +tokio = { version = "1.0", features = ["rt-multi-thread"] } warp = "0.3" [dev-dependencies] @@ -27,5 +36,5 @@ env_logger = "0.9" juniper = { version = "0.16.0-dev", path = "../juniper", features = ["expose-test-schema"] } log = "0.4" percent-encoding = "2.1" -tokio = { version = "1", features = ["macros", "rt-multi-thread"] } -url = "2" +tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } +url = "2.0" diff --git a/juniper_warp/LICENSE b/juniper_warp/LICENSE index 177ee843..9374ec2c 100644 --- a/juniper_warp/LICENSE +++ b/juniper_warp/LICENSE @@ -1,6 +1,6 @@ BSD 2-Clause License -Copyright (c) 2018, Tom Houlé +Copyright (c) 2018-2022, Tom Houlé All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/juniper_warp/Makefile.toml b/juniper_warp/Makefile.toml deleted file mode 100644 index e1437945..00000000 --- a/juniper_warp/Makefile.toml +++ /dev/null @@ -1,22 +0,0 @@ -[env] -CARGO_MAKE_CARGO_ALL_FEATURES = "" - -[tasks.build-verbose] -condition = { rust_version = { min = "1.29.0" } } - -[tasks.build-verbose.windows] -condition = { rust_version = { min = "1.29.0" }, env = { "TARGET" = "x86_64-pc-windows-msvc" } } - -[tasks.test-verbose] -condition = { rust_version = { min = "1.29.0" } } -args = ["test", "--all-features"] - -[tasks.test-verbose.windows] -condition = { rust_version = { min = "1.29.0" }, env = { "TARGET" = "x86_64-pc-windows-msvc" } } -args = ["test", "--all-features"] - -[tasks.ci-coverage-flow] -condition = { rust_version = { min = "1.29.0" } } - -[tasks.ci-coverage-flow.windows] -disabled = true diff --git a/juniper_warp/README.md b/juniper_warp/README.md index e283a605..4148f484 100644 --- a/juniper_warp/README.md +++ b/juniper_warp/README.md @@ -1,33 +1,45 @@ -# juniper_warp +`juniper_warp` crate +==================== + +[![Crates.io](https://img.shields.io/crates/v/juniper_warp.svg?maxAge=2592000)](https://crates.io/crates/juniper_warp) +[![Documentation](https://docs.rs/juniper_warp/badge.svg)](https://docs.rs/juniper_warp) +[![CI](https://github.com/graphql-rust/juniper/workflows/CI/badge.svg?branch=master "CI")](https://github.com/graphql-rust/juniper/actions?query=workflow%3ACI+branch%3Amaster) + +- [Changelog](https://github.com/graphql-rust/juniper/blob/master/juniper_warp/CHANGELOG.md) + +[`warp`] web server integration for [`juniper`] ([GraphQL] implementation for [Rust]). + + -This repository contains the [warp][warp] web server integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust. ## Documentation -For documentation, including guides and examples, check out [Juniper][Juniper]. +For documentation, including guides and examples, check out [Juniper Book]. + +A basic usage example can also be found in the [API docs][`juniper_warp`]. + + -A basic usage example can also be found in the [API documentation][documentation]. ## Examples -Check [examples/warp_server][example] for example code of a working warp -server with GraphQL handlers. +Check [`examples/warp_server.rs`][1] for example code of a working [`warp`] server with [GraphQL] handlers. + -## Links -* [Juniper][Juniper] -* [API Reference][documentation] -* [warp][warp] ## License -This project is under the BSD-2 license. +This project is licensed under [BSD 2-Clause License](https://github.com/graphql-rust/juniper/blob/master/juniper_warp/LICENSE). -Check the LICENSE file for details. -[warp]: https://github.com/seanmonstar/warp -[Juniper]: https://github.com/graphql-rust/juniper + + +[`juniper`]: https://docs.rs/juniper +[`juniper_warp`]: https://docs.rs/juniper_warp +[`warp`]: https://docs.rs/warp [GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_warp -[example]: https://github.com/graphql-rust/juniper/blob/master/juniper_warp/examples/warp_server.rs +[Juniper Book]: https://graphql-rust.github.io +[Rust]: https://www.rust-lang.org + +[1]: https://github.com/graphql-rust/juniper/blob/master/juniper_warp/examples/warp_server.rs diff --git a/juniper_warp/release.toml b/juniper_warp/release.toml new file mode 100644 index 00000000..283666df --- /dev/null +++ b/juniper_warp/release.toml @@ -0,0 +1,17 @@ +[[pre-release-replacements]] +file = "../book/src/servers/warp.md" +exactly = 1 +search = "juniper_warp = \"[^\"]+\"" +replace = "juniper_warp = \"{{version}}\"" + +[[pre-release-replacements]] +file = "CHANGELOG.md" +exactly = 1 +search = "## master" +replace = "## [{{version}}] · {{date}}\n[{{version}}]: /../../tree/{{crate_name}}%40{{version}}/{{crate_name}}" + +[[pre-release-replacements]] +file = "README.md" +exactly = 3 +search = "graphql-rust/juniper/blob/[^/]+/" +replace = "graphql-rust/juniper/blob/{{crate_name}}%40{{version}}/" diff --git a/juniper_warp/src/lib.rs b/juniper_warp/src/lib.rs index af3e86f2..e7686b8d 100644 --- a/juniper_warp/src/lib.rs +++ b/juniper_warp/src/lib.rs @@ -1,44 +1,7 @@ -/*! - -# juniper_warp - -This repository contains the [warp][warp] web server integration for -[Juniper][Juniper], a [GraphQL][GraphQL] implementation for Rust. - -## Documentation - -For documentation, including guides and examples, check out [Juniper][Juniper]. - -A basic usage example can also be found in the [Api documentation][documentation]. - -## Examples - -Check [examples/warp_server.rs][example] for example code of a working warp -server with GraphQL handlers. - -## Links - -* [Juniper][Juniper] -* [Api Reference][documentation] -* [warp][warp] - -## License - -This project is under the BSD-2 license. - -Check the LICENSE file for details. - -[warp]: https://github.com/seanmonstar/warp -[Juniper]: https://github.com/graphql-rust/juniper -[GraphQL]: http://graphql.org -[documentation]: https://docs.rs/juniper_warp -[example]: https://github.com/graphql-rust/juniper/blob/master/juniper_warp/examples/warp_server.rs - -*/ - +#![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_cfg))] #![deny(missing_docs)] #![deny(warnings)] -#![doc(html_root_url = "https://docs.rs/juniper_warp/0.2.0")] use std::{collections::HashMap, str, sync::Arc}; diff --git a/release.toml b/release.toml new file mode 100644 index 00000000..114359ce --- /dev/null +++ b/release.toml @@ -0,0 +1,3 @@ +pre-release-commit-message = "Prepare {{version}} release of `{{crate_name}}` crate" +tag-message = "{{version}} version of `{{crate_name}}` crate" +tag-name = "{{crate_name}}@{{version}}" diff --git a/integration_tests/codegen_fail/Cargo.toml b/tests/codegen/Cargo.toml similarity index 54% rename from integration_tests/codegen_fail/Cargo.toml rename to tests/codegen/Cargo.toml index f9f296c8..eb513bf3 100644 --- a/integration_tests/codegen_fail/Cargo.toml +++ b/tests/codegen/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "juniper_codegen_tests" -version = "0.1.0" -publish = false +version = "0.0.0" edition = "2018" +publish = false [dependencies] -juniper = { path = "../../juniper" } futures = "0.3.1" +juniper = { path = "../../juniper" } [dev-dependencies] -serde_json = { version = "1" } -tokio = { version = "1", features = ["rt", "time", "macros"] } -trybuild = "1.0.25" \ No newline at end of file +serde_json = { version = "1.0" } +tokio = { version = "1.0", features = ["rt", "time", "macros"] } +trybuild = "1.0.25" diff --git a/integration_tests/codegen_fail/fail/enum/derive_no_fields.rs b/tests/codegen/fail/enum/derive_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/enum/derive_no_fields.rs rename to tests/codegen/fail/enum/derive_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr b/tests/codegen/fail/enum/derive_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/enum/derive_no_fields.stderr rename to tests/codegen/fail/enum/derive_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.rs b/tests/codegen/fail/input-object/derive_incompatible_object.rs similarity index 100% rename from integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.rs rename to tests/codegen/fail/input-object/derive_incompatible_object.rs diff --git a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr b/tests/codegen/fail/input-object/derive_incompatible_object.stderr similarity index 61% rename from integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr rename to tests/codegen/fail/input-object/derive_incompatible_object.stderr index 53ac2dee..e8e2a3cc 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr +++ b/tests/codegen/fail/input-object/derive_incompatible_object.stderr @@ -3,6 +3,17 @@ error[E0277]: the trait bound `ObjectA: IsInputType<__S>` is not satisfied | 8 | field: ObjectA, | ^^^^^^^ the trait `IsInputType<__S>` is not implemented for `ObjectA` + | + = help: the following other types implement trait `IsInputType`: + <&T as IsInputType> + as IsInputType> + as IsInputType> + > + > + > + as IsInputType> + <[T; N] as IsInputType> + and 13 others error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied --> fail/input-object/derive_incompatible_object.rs:6:10 @@ -10,6 +21,16 @@ error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied 6 | #[derive(juniper::GraphQLInputObject)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjectA` | + = help: the following other types implement trait `FromInputValue`: + as FromInputValue> + as FromInputValue> + > + > + > + as FromInputValue> + <[T; N] as FromInputValue> + > + and 10 others note: required by a bound in `Registry::<'r, S>::arg` --> $WORKSPACE/juniper/src/executor/mod.rs | @@ -23,6 +44,16 @@ error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied 6 | #[derive(juniper::GraphQLInputObject)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjectA` | + = help: the following other types implement trait `FromInputValue`: + as FromInputValue> + as FromInputValue> + > + > + > + as FromInputValue> + <[T; N] as FromInputValue> + > + and 10 others = note: this error originates in the derive macro `juniper::GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no method named `to_input_value` found for struct `ObjectA` in the current scope diff --git a/integration_tests/codegen_fail/fail/input-object/derive_no_fields.rs b/tests/codegen/fail/input-object/derive_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/input-object/derive_no_fields.rs rename to tests/codegen/fail/input-object/derive_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr b/tests/codegen/fail/input-object/derive_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/input-object/derive_no_fields.stderr rename to tests/codegen/fail/input-object/derive_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.rs b/tests/codegen/fail/input-object/derive_no_underscore.rs similarity index 100% rename from integration_tests/codegen_fail/fail/input-object/derive_no_underscore.rs rename to tests/codegen/fail/input-object/derive_no_underscore.rs diff --git a/integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr b/tests/codegen/fail/input-object/derive_no_underscore.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/input-object/derive_no_underscore.stderr rename to tests/codegen/fail/input-object/derive_no_underscore.stderr diff --git a/integration_tests/codegen_fail/fail/input-object/derive_unique_name.rs b/tests/codegen/fail/input-object/derive_unique_name.rs similarity index 100% rename from integration_tests/codegen_fail/fail/input-object/derive_unique_name.rs rename to tests/codegen/fail/input-object/derive_unique_name.rs diff --git a/integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr b/tests/codegen/fail/input-object/derive_unique_name.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/input-object/derive_unique_name.stderr rename to tests/codegen/fail/input-object/derive_unique_name.stderr diff --git a/integration_tests/codegen_fail/fail/interface/attr_wrong_item.rs b/tests/codegen/fail/interface/attr_wrong_item.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/attr_wrong_item.rs rename to tests/codegen/fail/interface/attr_wrong_item.rs diff --git a/integration_tests/codegen_fail/fail/interface/attr_wrong_item.stderr b/tests/codegen/fail/interface/attr_wrong_item.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/attr_wrong_item.stderr rename to tests/codegen/fail/interface/attr_wrong_item.stderr diff --git a/integration_tests/codegen_fail/fail/interface/derive_wrong_item.rs b/tests/codegen/fail/interface/derive_wrong_item.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/derive_wrong_item.rs rename to tests/codegen/fail/interface/derive_wrong_item.rs diff --git a/integration_tests/codegen_fail/fail/interface/derive_wrong_item.stderr b/tests/codegen/fail/interface/derive_wrong_item.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/derive_wrong_item.stderr rename to tests/codegen/fail/interface/derive_wrong_item.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_additional_non_nullable_argument.rs b/tests/codegen/fail/interface/struct/attr_additional_non_nullable_argument.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_additional_non_nullable_argument.rs rename to tests/codegen/fail/interface/struct/attr_additional_non_nullable_argument.rs diff --git a/tests/codegen/fail/interface/struct/attr_additional_non_nullable_argument.stderr b/tests/codegen/fail/interface/struct/attr_additional_non_nullable_argument.stderr new file mode 100644 index 00000000..a1b8ce2f --- /dev/null +++ b/tests/codegen/fail/interface/struct/attr_additional_non_nullable_argument.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/attr_additional_non_nullable_argument.rs:16:5 + | +16 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/struct/attr_additional_non_nullable_argument.rs:16:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/attr_additional_non_nullable_argument.rs:16:5 + | +16 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/struct/attr_additional_non_nullable_argument.rs:16:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_field_double_underscored.rs b/tests/codegen/fail/interface/struct/attr_field_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_field_double_underscored.rs rename to tests/codegen/fail/interface/struct/attr_field_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_field_double_underscored.stderr b/tests/codegen/fail/interface/struct/attr_field_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_field_double_underscored.stderr rename to tests/codegen/fail/interface/struct/attr_field_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_field_non_output_return_type.rs b/tests/codegen/fail/interface/struct/attr_field_non_output_return_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_field_non_output_return_type.rs rename to tests/codegen/fail/interface/struct/attr_field_non_output_return_type.rs diff --git a/tests/codegen/fail/interface/struct/attr_field_non_output_return_type.stderr b/tests/codegen/fail/interface/struct/attr_field_non_output_return_type.stderr new file mode 100644 index 00000000..8ddf287d --- /dev/null +++ b/tests/codegen/fail/interface/struct/attr_field_non_output_return_type.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied + --> fail/interface/struct/attr_field_non_output_return_type.rs:10:9 + | +10 | id: ObjB, + | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + <&T as IsOutputType> + as IsOutputType> + as IsOutputType> + > + > + > + as IsOutputType> + > + and 18 others diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_fields_duplicate.rs b/tests/codegen/fail/interface/struct/attr_fields_duplicate.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_fields_duplicate.rs rename to tests/codegen/fail/interface/struct/attr_fields_duplicate.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_fields_duplicate.stderr b/tests/codegen/fail/interface/struct/attr_fields_duplicate.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_fields_duplicate.stderr rename to tests/codegen/fail/interface/struct/attr_fields_duplicate.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_implementers_duplicate_pretty.rs b/tests/codegen/fail/interface/struct/attr_implementers_duplicate_pretty.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_implementers_duplicate_pretty.rs rename to tests/codegen/fail/interface/struct/attr_implementers_duplicate_pretty.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_implementers_duplicate_pretty.stderr b/tests/codegen/fail/interface/struct/attr_implementers_duplicate_pretty.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_implementers_duplicate_pretty.stderr rename to tests/codegen/fail/interface/struct/attr_implementers_duplicate_pretty.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_implementers_duplicate_ugly.rs b/tests/codegen/fail/interface/struct/attr_implementers_duplicate_ugly.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_implementers_duplicate_ugly.rs rename to tests/codegen/fail/interface/struct/attr_implementers_duplicate_ugly.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_implementers_duplicate_ugly.stderr b/tests/codegen/fail/interface/struct/attr_implementers_duplicate_ugly.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_implementers_duplicate_ugly.stderr rename to tests/codegen/fail/interface/struct/attr_implementers_duplicate_ugly.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_missing_field.rs b/tests/codegen/fail/interface/struct/attr_missing_field.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_missing_field.rs rename to tests/codegen/fail/interface/struct/attr_missing_field.rs diff --git a/tests/codegen/fail/interface/struct/attr_missing_field.stderr b/tests/codegen/fail/interface/struct/attr_missing_field.stderr new file mode 100644 index 00000000..3d479ce5 --- /dev/null +++ b/tests/codegen/fail/interface/struct/attr_missing_field.stderr @@ -0,0 +1,63 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/attr_missing_field.rs:11:5 + | +11 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/attr_missing_field.rs:11:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/struct/attr_missing_field.rs:11:5 + | +11 | id: String, + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/struct/attr_missing_field.rs:11:5 + | +11 | id: String, + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/attr_missing_field.rs:11:5 + | +11 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/attr_missing_field.rs:11:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/attr_missing_field.rs:11:5 + | +11 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/attr_missing_field.rs:11:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/struct/attr_missing_field.rs:11:5 + | +11 | id: String, + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/struct/attr_missing_field.rs:11:5 + | +11 | id: String, + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/attr_missing_field.rs:11:5 + | +11 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/attr_missing_field.rs:11:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_missing_for_attr.rs b/tests/codegen/fail/interface/struct/attr_missing_for_attr.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_missing_for_attr.rs rename to tests/codegen/fail/interface/struct/attr_missing_for_attr.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_missing_for_attr.stderr b/tests/codegen/fail/interface/struct/attr_missing_for_attr.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_missing_for_attr.stderr rename to tests/codegen/fail/interface/struct/attr_missing_for_attr.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_missing_impl_attr.rs b/tests/codegen/fail/interface/struct/attr_missing_impl_attr.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_missing_impl_attr.rs rename to tests/codegen/fail/interface/struct/attr_missing_impl_attr.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_missing_impl_attr.stderr b/tests/codegen/fail/interface/struct/attr_missing_impl_attr.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_missing_impl_attr.stderr rename to tests/codegen/fail/interface/struct/attr_missing_impl_attr.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_name_double_underscored.rs b/tests/codegen/fail/interface/struct/attr_name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_name_double_underscored.rs rename to tests/codegen/fail/interface/struct/attr_name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_name_double_underscored.stderr b/tests/codegen/fail/interface/struct/attr_name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_name_double_underscored.stderr rename to tests/codegen/fail/interface/struct/attr_name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_no_fields.rs b/tests/codegen/fail/interface/struct/attr_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_no_fields.rs rename to tests/codegen/fail/interface/struct/attr_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_no_fields.stderr b/tests/codegen/fail/interface/struct/attr_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_no_fields.stderr rename to tests/codegen/fail/interface/struct/attr_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_non_subtype_return.rs b/tests/codegen/fail/interface/struct/attr_non_subtype_return.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_non_subtype_return.rs rename to tests/codegen/fail/interface/struct/attr_non_subtype_return.rs diff --git a/tests/codegen/fail/interface/struct/attr_non_subtype_return.stderr b/tests/codegen/fail/interface/struct/attr_non_subtype_return.stderr new file mode 100644 index 00000000..c5d9903c --- /dev/null +++ b/tests/codegen/fail/interface/struct/attr_non_subtype_return.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/attr_non_subtype_return.rs:11:5 + | +11 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/struct/attr_non_subtype_return.rs:11:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/attr_non_subtype_return.rs:11:5 + | +11 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/struct/attr_non_subtype_return.rs:11:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_unnamed_field.rs b/tests/codegen/fail/interface/struct/attr_unnamed_field.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_unnamed_field.rs rename to tests/codegen/fail/interface/struct/attr_unnamed_field.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/attr_unnamed_field.stderr b/tests/codegen/fail/interface/struct/attr_unnamed_field.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/attr_unnamed_field.stderr rename to tests/codegen/fail/interface/struct/attr_unnamed_field.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_additional_non_nullable_argument.rs b/tests/codegen/fail/interface/struct/derive_additional_non_nullable_argument.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_additional_non_nullable_argument.rs rename to tests/codegen/fail/interface/struct/derive_additional_non_nullable_argument.rs diff --git a/tests/codegen/fail/interface/struct/derive_additional_non_nullable_argument.stderr b/tests/codegen/fail/interface/struct/derive_additional_non_nullable_argument.stderr new file mode 100644 index 00000000..aa1fd8ee --- /dev/null +++ b/tests/codegen/fail/interface/struct/derive_additional_non_nullable_argument.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/derive_additional_non_nullable_argument.rs:17:5 + | +17 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/struct/derive_additional_non_nullable_argument.rs:17:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/derive_additional_non_nullable_argument.rs:17:5 + | +17 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/struct/derive_additional_non_nullable_argument.rs:17:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_field_double_underscored.rs b/tests/codegen/fail/interface/struct/derive_field_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_field_double_underscored.rs rename to tests/codegen/fail/interface/struct/derive_field_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_field_double_underscored.stderr b/tests/codegen/fail/interface/struct/derive_field_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_field_double_underscored.stderr rename to tests/codegen/fail/interface/struct/derive_field_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_field_non_output_return_type.rs b/tests/codegen/fail/interface/struct/derive_field_non_output_return_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_field_non_output_return_type.rs rename to tests/codegen/fail/interface/struct/derive_field_non_output_return_type.rs diff --git a/tests/codegen/fail/interface/struct/derive_field_non_output_return_type.stderr b/tests/codegen/fail/interface/struct/derive_field_non_output_return_type.stderr new file mode 100644 index 00000000..bc9a79a7 --- /dev/null +++ b/tests/codegen/fail/interface/struct/derive_field_non_output_return_type.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied + --> fail/interface/struct/derive_field_non_output_return_type.rs:10:9 + | +10 | id: ObjB, + | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + <&T as IsOutputType> + as IsOutputType> + as IsOutputType> + > + > + > + as IsOutputType> + > + and 18 others diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_fields_duplicate.rs b/tests/codegen/fail/interface/struct/derive_fields_duplicate.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_fields_duplicate.rs rename to tests/codegen/fail/interface/struct/derive_fields_duplicate.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_fields_duplicate.stderr b/tests/codegen/fail/interface/struct/derive_fields_duplicate.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_fields_duplicate.stderr rename to tests/codegen/fail/interface/struct/derive_fields_duplicate.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_implementers_duplicate_pretty.rs b/tests/codegen/fail/interface/struct/derive_implementers_duplicate_pretty.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_implementers_duplicate_pretty.rs rename to tests/codegen/fail/interface/struct/derive_implementers_duplicate_pretty.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_implementers_duplicate_pretty.stderr b/tests/codegen/fail/interface/struct/derive_implementers_duplicate_pretty.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_implementers_duplicate_pretty.stderr rename to tests/codegen/fail/interface/struct/derive_implementers_duplicate_pretty.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_implementers_duplicate_ugly.rs b/tests/codegen/fail/interface/struct/derive_implementers_duplicate_ugly.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_implementers_duplicate_ugly.rs rename to tests/codegen/fail/interface/struct/derive_implementers_duplicate_ugly.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_implementers_duplicate_ugly.stderr b/tests/codegen/fail/interface/struct/derive_implementers_duplicate_ugly.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_implementers_duplicate_ugly.stderr rename to tests/codegen/fail/interface/struct/derive_implementers_duplicate_ugly.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_missing_field.rs b/tests/codegen/fail/interface/struct/derive_missing_field.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_missing_field.rs rename to tests/codegen/fail/interface/struct/derive_missing_field.rs diff --git a/tests/codegen/fail/interface/struct/derive_missing_field.stderr b/tests/codegen/fail/interface/struct/derive_missing_field.stderr new file mode 100644 index 00000000..1e1989bc --- /dev/null +++ b/tests/codegen/fail/interface/struct/derive_missing_field.stderr @@ -0,0 +1,63 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/derive_missing_field.rs:12:5 + | +12 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/derive_missing_field.rs:12:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/struct/derive_missing_field.rs:12:5 + | +12 | id: String, + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/struct/derive_missing_field.rs:12:5 + | +12 | id: String, + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/derive_missing_field.rs:12:5 + | +12 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/derive_missing_field.rs:12:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/derive_missing_field.rs:12:5 + | +12 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/derive_missing_field.rs:12:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/struct/derive_missing_field.rs:12:5 + | +12 | id: String, + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/struct/derive_missing_field.rs:12:5 + | +12 | id: String, + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/derive_missing_field.rs:12:5 + | +12 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/struct/derive_missing_field.rs:12:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_missing_for_attr.rs b/tests/codegen/fail/interface/struct/derive_missing_for_attr.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_missing_for_attr.rs rename to tests/codegen/fail/interface/struct/derive_missing_for_attr.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_missing_for_attr.stderr b/tests/codegen/fail/interface/struct/derive_missing_for_attr.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_missing_for_attr.stderr rename to tests/codegen/fail/interface/struct/derive_missing_for_attr.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_missing_impl_attr.rs b/tests/codegen/fail/interface/struct/derive_missing_impl_attr.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_missing_impl_attr.rs rename to tests/codegen/fail/interface/struct/derive_missing_impl_attr.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_missing_impl_attr.stderr b/tests/codegen/fail/interface/struct/derive_missing_impl_attr.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_missing_impl_attr.stderr rename to tests/codegen/fail/interface/struct/derive_missing_impl_attr.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_name_double_underscored.rs b/tests/codegen/fail/interface/struct/derive_name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_name_double_underscored.rs rename to tests/codegen/fail/interface/struct/derive_name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_name_double_underscored.stderr b/tests/codegen/fail/interface/struct/derive_name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_name_double_underscored.stderr rename to tests/codegen/fail/interface/struct/derive_name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_no_fields.rs b/tests/codegen/fail/interface/struct/derive_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_no_fields.rs rename to tests/codegen/fail/interface/struct/derive_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_no_fields.stderr b/tests/codegen/fail/interface/struct/derive_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_no_fields.stderr rename to tests/codegen/fail/interface/struct/derive_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_non_subtype_return.rs b/tests/codegen/fail/interface/struct/derive_non_subtype_return.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_non_subtype_return.rs rename to tests/codegen/fail/interface/struct/derive_non_subtype_return.rs diff --git a/tests/codegen/fail/interface/struct/derive_non_subtype_return.stderr b/tests/codegen/fail/interface/struct/derive_non_subtype_return.stderr new file mode 100644 index 00000000..b62b6b0f --- /dev/null +++ b/tests/codegen/fail/interface/struct/derive_non_subtype_return.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/derive_non_subtype_return.rs:12:5 + | +12 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/struct/derive_non_subtype_return.rs:12:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/struct/derive_non_subtype_return.rs:12:5 + | +12 | id: String, + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/struct/derive_non_subtype_return.rs:12:5 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_unnamed_field.rs b/tests/codegen/fail/interface/struct/derive_unnamed_field.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_unnamed_field.rs rename to tests/codegen/fail/interface/struct/derive_unnamed_field.rs diff --git a/integration_tests/codegen_fail/fail/interface/struct/derive_unnamed_field.stderr b/tests/codegen/fail/interface/struct/derive_unnamed_field.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/struct/derive_unnamed_field.stderr rename to tests/codegen/fail/interface/struct/derive_unnamed_field.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/additional_non_nullable_argument.rs b/tests/codegen/fail/interface/trait/additional_non_nullable_argument.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/additional_non_nullable_argument.rs rename to tests/codegen/fail/interface/trait/additional_non_nullable_argument.rs diff --git a/tests/codegen/fail/interface/trait/additional_non_nullable_argument.stderr b/tests/codegen/fail/interface/trait/additional_non_nullable_argument.stderr new file mode 100644 index 00000000..4817ef41 --- /dev/null +++ b/tests/codegen/fail/interface/trait/additional_non_nullable_argument.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/additional_non_nullable_argument.rs:16:8 + | +16 | fn id(&self) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/trait/additional_non_nullable_argument.rs:16:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/additional_non_nullable_argument.rs:16:8 + | +16 | fn id(&self) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` isn't present on the interface and so has to be nullable.', $DIR/fail/interface/trait/additional_non_nullable_argument.rs:16:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/argument_double_underscored.rs b/tests/codegen/fail/interface/trait/argument_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/argument_double_underscored.rs rename to tests/codegen/fail/interface/trait/argument_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/argument_double_underscored.stderr b/tests/codegen/fail/interface/trait/argument_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/argument_double_underscored.stderr rename to tests/codegen/fail/interface/trait/argument_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/argument_non_input_type.rs b/tests/codegen/fail/interface/trait/argument_non_input_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/argument_non_input_type.rs rename to tests/codegen/fail/interface/trait/argument_non_input_type.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/argument_non_input_type.stderr b/tests/codegen/fail/interface/trait/argument_non_input_type.stderr similarity index 51% rename from integration_tests/codegen_fail/fail/interface/trait/argument_non_input_type.stderr rename to tests/codegen/fail/interface/trait/argument_non_input_type.stderr index c532bab1..a085a84f 100644 --- a/integration_tests/codegen_fail/fail/interface/trait/argument_non_input_type.stderr +++ b/tests/codegen/fail/interface/trait/argument_non_input_type.stderr @@ -3,6 +3,17 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied | 10 | fn id(&self, obj: ObjA) -> &str; | ^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` + | + = help: the following other types implement trait `IsInputType`: + <&T as IsInputType> + as IsInputType> + as IsInputType> + > + > + as IsInputType> + <[T; N] as IsInputType> + <[T] as IsInputType> + and 12 others error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied --> fail/interface/trait/argument_non_input_type.rs:8:1 @@ -10,6 +21,16 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied 8 | #[graphql_interface] | ^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` | + = help: the following other types implement trait `FromInputValue`: + as FromInputValue> + as FromInputValue> + > + > + as FromInputValue> + <[T; N] as FromInputValue> + > + > + and 9 others note: required by a bound in `Registry::<'r, S>::arg` --> $WORKSPACE/juniper/src/executor/mod.rs | diff --git a/integration_tests/codegen_fail/fail/interface/trait/argument_wrong_default_array.rs b/tests/codegen/fail/interface/trait/argument_wrong_default_array.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/argument_wrong_default_array.rs rename to tests/codegen/fail/interface/trait/argument_wrong_default_array.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/argument_wrong_default_array.stderr b/tests/codegen/fail/interface/trait/argument_wrong_default_array.stderr similarity index 71% rename from integration_tests/codegen_fail/fail/interface/trait/argument_wrong_default_array.stderr rename to tests/codegen/fail/interface/trait/argument_wrong_default_array.stderr index d609ce02..c8a00ea3 100644 --- a/integration_tests/codegen_fail/fail/interface/trait/argument_wrong_default_array.stderr +++ b/tests/codegen/fail/interface/trait/argument_wrong_default_array.stderr @@ -4,11 +4,15 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied 3 | #[graphql_interface] | ^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | - = help: the following implementations were found: + = help: the following other types implement trait `From`: <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> <&'a [u32; 4] as From<&'a ppv_lite86::x86_64::vec128_storage>> <&'a [u8] as From<&'a ascii::ascii_str::AsciiStr>> <&'a mut [ascii::ascii_char::AsciiChar] as From<&'a mut ascii::ascii_str::AsciiStr>> - and 11 others + <[T; LANES] as From>> + <[bool; LANES] as From>> + <[u128; 1] as From> + <[u128; 2] as From> + and 7 others = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` = note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/field_double_underscored.rs b/tests/codegen/fail/interface/trait/field_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/field_double_underscored.rs rename to tests/codegen/fail/interface/trait/field_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/field_double_underscored.stderr b/tests/codegen/fail/interface/trait/field_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/field_double_underscored.stderr rename to tests/codegen/fail/interface/trait/field_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/field_non_output_return_type.rs b/tests/codegen/fail/interface/trait/field_non_output_return_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/field_non_output_return_type.rs rename to tests/codegen/fail/interface/trait/field_non_output_return_type.rs diff --git a/tests/codegen/fail/interface/trait/field_non_output_return_type.stderr b/tests/codegen/fail/interface/trait/field_non_output_return_type.stderr new file mode 100644 index 00000000..e1042ff9 --- /dev/null +++ b/tests/codegen/fail/interface/trait/field_non_output_return_type.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied + --> fail/interface/trait/field_non_output_return_type.rs:10:21 + | +10 | fn id(&self) -> ObjB; + | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + <&T as IsOutputType> + as IsOutputType> + as IsOutputType> + > + > + > + as IsOutputType> + > + and 18 others diff --git a/integration_tests/codegen_fail/fail/interface/trait/fields_duplicate.rs b/tests/codegen/fail/interface/trait/fields_duplicate.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/fields_duplicate.rs rename to tests/codegen/fail/interface/trait/fields_duplicate.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/fields_duplicate.stderr b/tests/codegen/fail/interface/trait/fields_duplicate.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/fields_duplicate.stderr rename to tests/codegen/fail/interface/trait/fields_duplicate.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/implementers_duplicate_pretty.rs b/tests/codegen/fail/interface/trait/implementers_duplicate_pretty.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/implementers_duplicate_pretty.rs rename to tests/codegen/fail/interface/trait/implementers_duplicate_pretty.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/implementers_duplicate_pretty.stderr b/tests/codegen/fail/interface/trait/implementers_duplicate_pretty.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/implementers_duplicate_pretty.stderr rename to tests/codegen/fail/interface/trait/implementers_duplicate_pretty.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/implementers_duplicate_ugly.rs b/tests/codegen/fail/interface/trait/implementers_duplicate_ugly.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/implementers_duplicate_ugly.rs rename to tests/codegen/fail/interface/trait/implementers_duplicate_ugly.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/implementers_duplicate_ugly.stderr b/tests/codegen/fail/interface/trait/implementers_duplicate_ugly.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/implementers_duplicate_ugly.stderr rename to tests/codegen/fail/interface/trait/implementers_duplicate_ugly.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/method_default_impl.rs b/tests/codegen/fail/interface/trait/method_default_impl.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/method_default_impl.rs rename to tests/codegen/fail/interface/trait/method_default_impl.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/method_default_impl.stderr b/tests/codegen/fail/interface/trait/method_default_impl.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/method_default_impl.stderr rename to tests/codegen/fail/interface/trait/method_default_impl.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/missing_field.rs b/tests/codegen/fail/interface/trait/missing_field.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/missing_field.rs rename to tests/codegen/fail/interface/trait/missing_field.rs diff --git a/tests/codegen/fail/interface/trait/missing_field.stderr b/tests/codegen/fail/interface/trait/missing_field.stderr new file mode 100644 index 00000000..6a6cda06 --- /dev/null +++ b/tests/codegen/fail/interface/trait/missing_field.stderr @@ -0,0 +1,63 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/missing_field.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/trait/missing_field.rs:11:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/trait/missing_field.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/trait/missing_field.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/missing_field.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/trait/missing_field.rs:11:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/missing_field.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/trait/missing_field.rs:11:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/trait/missing_field.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: erroneous constant used + --> fail/interface/trait/missing_field.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ referenced constant has errors + | + = note: this error originates in the macro `$crate::assert_field_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/missing_field.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id` isn't implemented on `ObjA`.', $DIR/fail/interface/trait/missing_field.rs:11:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/missing_field_argument.rs b/tests/codegen/fail/interface/trait/missing_field_argument.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/missing_field_argument.rs rename to tests/codegen/fail/interface/trait/missing_field_argument.rs diff --git a/tests/codegen/fail/interface/trait/missing_field_argument.stderr b/tests/codegen/fail/interface/trait/missing_field_argument.stderr new file mode 100644 index 00000000..276222f7 --- /dev/null +++ b/tests/codegen/fail/interface/trait/missing_field_argument.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/missing_field_argument.rs:16:8 + | +16 | fn id(&self, is_present: bool) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` was expected, but not found.', $DIR/fail/interface/trait/missing_field_argument.rs:16:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/missing_field_argument.rs:16:8 + | +16 | fn id(&self, is_present: bool) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent` of type `Boolean!` was expected, but not found.', $DIR/fail/interface/trait/missing_field_argument.rs:16:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/missing_for_attr.rs b/tests/codegen/fail/interface/trait/missing_for_attr.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/missing_for_attr.rs rename to tests/codegen/fail/interface/trait/missing_for_attr.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/missing_for_attr.stderr b/tests/codegen/fail/interface/trait/missing_for_attr.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/missing_for_attr.stderr rename to tests/codegen/fail/interface/trait/missing_for_attr.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/missing_impl_attr.rs b/tests/codegen/fail/interface/trait/missing_impl_attr.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/missing_impl_attr.rs rename to tests/codegen/fail/interface/trait/missing_impl_attr.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/missing_impl_attr.stderr b/tests/codegen/fail/interface/trait/missing_impl_attr.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/missing_impl_attr.stderr rename to tests/codegen/fail/interface/trait/missing_impl_attr.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/name_double_underscored.rs b/tests/codegen/fail/interface/trait/name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/name_double_underscored.rs rename to tests/codegen/fail/interface/trait/name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/name_double_underscored.stderr b/tests/codegen/fail/interface/trait/name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/name_double_underscored.stderr rename to tests/codegen/fail/interface/trait/name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/no_fields.rs b/tests/codegen/fail/interface/trait/no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/no_fields.rs rename to tests/codegen/fail/interface/trait/no_fields.rs diff --git a/integration_tests/codegen_fail/fail/interface/trait/no_fields.stderr b/tests/codegen/fail/interface/trait/no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/no_fields.stderr rename to tests/codegen/fail/interface/trait/no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/interface/trait/non_subtype_return.rs b/tests/codegen/fail/interface/trait/non_subtype_return.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/non_subtype_return.rs rename to tests/codegen/fail/interface/trait/non_subtype_return.rs diff --git a/tests/codegen/fail/interface/trait/non_subtype_return.stderr b/tests/codegen/fail/interface/trait/non_subtype_return.stderr new file mode 100644 index 00000000..92e123f2 --- /dev/null +++ b/tests/codegen/fail/interface/trait/non_subtype_return.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/non_subtype_return.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/trait/non_subtype_return.rs:11:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/non_subtype_return.rs:11:8 + | +11 | fn id(&self) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: implementor is expected to return a subtype of interface's return object: `[String!]!` is not a subtype of `String!`.', $DIR/fail/interface/trait/non_subtype_return.rs:11:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/trait/wrong_argument_type.rs b/tests/codegen/fail/interface/trait/wrong_argument_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/interface/trait/wrong_argument_type.rs rename to tests/codegen/fail/interface/trait/wrong_argument_type.rs diff --git a/tests/codegen/fail/interface/trait/wrong_argument_type.stderr b/tests/codegen/fail/interface/trait/wrong_argument_type.stderr new file mode 100644 index 00000000..3a47b725 --- /dev/null +++ b/tests/codegen/fail/interface/trait/wrong_argument_type.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/wrong_argument_type.rs:16:8 + | +16 | fn id(&self, is_present: bool) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent`: expected type `Boolean!`, found: `Int!`.', $DIR/fail/interface/trait/wrong_argument_type.rs:16:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0080]: evaluation of constant value failed + --> fail/interface/trait/wrong_argument_type.rs:16:8 + | +16 | fn id(&self, is_present: bool) -> &str; + | ^^ the evaluated program panicked at 'Failed to implement interface `Character` on `ObjA`: Field `id`: Argument `isPresent`: expected type `Boolean!`, found: `Int!`.', $DIR/fail/interface/trait/wrong_argument_type.rs:16:8 + | + = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/argument_double_underscored.rs b/tests/codegen/fail/object/argument_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/argument_double_underscored.rs rename to tests/codegen/fail/object/argument_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/object/argument_double_underscored.stderr b/tests/codegen/fail/object/argument_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/argument_double_underscored.stderr rename to tests/codegen/fail/object/argument_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/object/argument_non_input_type.rs b/tests/codegen/fail/object/argument_non_input_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/argument_non_input_type.rs rename to tests/codegen/fail/object/argument_non_input_type.rs diff --git a/tests/codegen/fail/object/argument_non_input_type.stderr b/tests/codegen/fail/object/argument_non_input_type.stderr new file mode 100644 index 00000000..1683fef0 --- /dev/null +++ b/tests/codegen/fail/object/argument_non_input_type.stderr @@ -0,0 +1,57 @@ +error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied + --> fail/object/argument_non_input_type.rs:12:23 + | +12 | fn id(&self, obj: ObjA) -> &str { + | ^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` + | + = help: the following other types implement trait `IsInputType`: + <&T as IsInputType> + as IsInputType> + as IsInputType> + > + > + as IsInputType> + <[T; N] as IsInputType> + <[T] as IsInputType> + and 12 others + +error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied + --> fail/object/argument_non_input_type.rs:10:1 + | +10 | #[graphql_object] + | ^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | + = help: the following other types implement trait `FromInputValue`: + as FromInputValue> + as FromInputValue> + > + > + as FromInputValue> + <[T; N] as FromInputValue> + > + > + and 9 others +note: required by a bound in `Registry::<'r, S>::arg` + --> $WORKSPACE/juniper/src/executor/mod.rs + | + | T: GraphQLType + FromInputValue, + | ^^^^^^^^^^^^^^^^^ required by this bound in `Registry::<'r, S>::arg` + = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied + --> fail/object/argument_non_input_type.rs:10:1 + | +10 | #[graphql_object] + | ^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` + | + = help: the following other types implement trait `FromInputValue`: + as FromInputValue> + as FromInputValue> + > + > + as FromInputValue> + <[T; N] as FromInputValue> + > + > + and 9 others + = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/argument_wrong_default_array.rs b/tests/codegen/fail/object/argument_wrong_default_array.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/argument_wrong_default_array.rs rename to tests/codegen/fail/object/argument_wrong_default_array.rs diff --git a/integration_tests/codegen_fail/fail/object/argument_wrong_default_array.stderr b/tests/codegen/fail/object/argument_wrong_default_array.stderr similarity index 71% rename from integration_tests/codegen_fail/fail/object/argument_wrong_default_array.stderr rename to tests/codegen/fail/object/argument_wrong_default_array.stderr index 1e65f81c..76357529 100644 --- a/integration_tests/codegen_fail/fail/object/argument_wrong_default_array.stderr +++ b/tests/codegen/fail/object/argument_wrong_default_array.stderr @@ -4,11 +4,15 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied 5 | #[graphql_object] | ^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | - = help: the following implementations were found: + = help: the following other types implement trait `From`: <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> <&'a [u32; 4] as From<&'a ppv_lite86::x86_64::vec128_storage>> <&'a [u8] as From<&'a ascii::ascii_str::AsciiStr>> <&'a mut [ascii::ascii_char::AsciiChar] as From<&'a mut ascii::ascii_str::AsciiStr>> - and 11 others + <[T; LANES] as From>> + <[bool; LANES] as From>> + <[u128; 1] as From> + <[u128; 2] as From> + and 7 others = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` = note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/attr_field_double_underscored.rs b/tests/codegen/fail/object/attr_field_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_field_double_underscored.rs rename to tests/codegen/fail/object/attr_field_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/object/attr_field_double_underscored.stderr b/tests/codegen/fail/object/attr_field_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_field_double_underscored.stderr rename to tests/codegen/fail/object/attr_field_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.rs b/tests/codegen/fail/object/attr_field_non_output_return_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_field_non_output_return_type.rs rename to tests/codegen/fail/object/attr_field_non_output_return_type.rs diff --git a/tests/codegen/fail/object/attr_field_non_output_return_type.stderr b/tests/codegen/fail/object/attr_field_non_output_return_type.stderr new file mode 100644 index 00000000..079f3566 --- /dev/null +++ b/tests/codegen/fail/object/attr_field_non_output_return_type.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied + --> fail/object/attr_field_non_output_return_type.rs:12:21 + | +12 | fn id(&self) -> ObjB { + | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + <&T as IsOutputType> + as IsOutputType> + as IsOutputType> + > + > + > + as IsOutputType> + > + and 18 others diff --git a/integration_tests/codegen_fail/fail/object/attr_fields_duplicate.rs b/tests/codegen/fail/object/attr_fields_duplicate.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_fields_duplicate.rs rename to tests/codegen/fail/object/attr_fields_duplicate.rs diff --git a/integration_tests/codegen_fail/fail/object/attr_fields_duplicate.stderr b/tests/codegen/fail/object/attr_fields_duplicate.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_fields_duplicate.stderr rename to tests/codegen/fail/object/attr_fields_duplicate.stderr diff --git a/integration_tests/codegen_fail/fail/object/attr_name_double_underscored.rs b/tests/codegen/fail/object/attr_name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_name_double_underscored.rs rename to tests/codegen/fail/object/attr_name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/object/attr_name_double_underscored.stderr b/tests/codegen/fail/object/attr_name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_name_double_underscored.stderr rename to tests/codegen/fail/object/attr_name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/object/attr_no_fields.rs b/tests/codegen/fail/object/attr_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_no_fields.rs rename to tests/codegen/fail/object/attr_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/object/attr_no_fields.stderr b/tests/codegen/fail/object/attr_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_no_fields.stderr rename to tests/codegen/fail/object/attr_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/object/attr_wrong_item.rs b/tests/codegen/fail/object/attr_wrong_item.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_wrong_item.rs rename to tests/codegen/fail/object/attr_wrong_item.rs diff --git a/integration_tests/codegen_fail/fail/object/attr_wrong_item.stderr b/tests/codegen/fail/object/attr_wrong_item.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/attr_wrong_item.stderr rename to tests/codegen/fail/object/attr_wrong_item.stderr diff --git a/integration_tests/codegen_fail/fail/object/derive_field_double_underscored.rs b/tests/codegen/fail/object/derive_field_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_field_double_underscored.rs rename to tests/codegen/fail/object/derive_field_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/object/derive_field_double_underscored.stderr b/tests/codegen/fail/object/derive_field_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_field_double_underscored.stderr rename to tests/codegen/fail/object/derive_field_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.rs b/tests/codegen/fail/object/derive_field_non_output_return_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_field_non_output_return_type.rs rename to tests/codegen/fail/object/derive_field_non_output_return_type.rs diff --git a/tests/codegen/fail/object/derive_field_non_output_return_type.stderr b/tests/codegen/fail/object/derive_field_non_output_return_type.stderr new file mode 100644 index 00000000..2ce49070 --- /dev/null +++ b/tests/codegen/fail/object/derive_field_non_output_return_type.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied + --> fail/object/derive_field_non_output_return_type.rs:10:9 + | +10 | id: ObjB, + | ^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + <&T as IsOutputType> + as IsOutputType> + as IsOutputType> + > + > + > + as IsOutputType> + > + and 18 others diff --git a/integration_tests/codegen_fail/fail/object/derive_fields_duplicate.rs b/tests/codegen/fail/object/derive_fields_duplicate.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_fields_duplicate.rs rename to tests/codegen/fail/object/derive_fields_duplicate.rs diff --git a/integration_tests/codegen_fail/fail/object/derive_fields_duplicate.stderr b/tests/codegen/fail/object/derive_fields_duplicate.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_fields_duplicate.stderr rename to tests/codegen/fail/object/derive_fields_duplicate.stderr diff --git a/integration_tests/codegen_fail/fail/object/derive_name_double_underscored.rs b/tests/codegen/fail/object/derive_name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_name_double_underscored.rs rename to tests/codegen/fail/object/derive_name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/object/derive_name_double_underscored.stderr b/tests/codegen/fail/object/derive_name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_name_double_underscored.stderr rename to tests/codegen/fail/object/derive_name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/object/derive_no_fields.rs b/tests/codegen/fail/object/derive_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_no_fields.rs rename to tests/codegen/fail/object/derive_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/object/derive_no_fields.stderr b/tests/codegen/fail/object/derive_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_no_fields.stderr rename to tests/codegen/fail/object/derive_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/object/derive_wrong_item.rs b/tests/codegen/fail/object/derive_wrong_item.rs similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_wrong_item.rs rename to tests/codegen/fail/object/derive_wrong_item.rs diff --git a/integration_tests/codegen_fail/fail/object/derive_wrong_item.stderr b/tests/codegen/fail/object/derive_wrong_item.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/object/derive_wrong_item.stderr rename to tests/codegen/fail/object/derive_wrong_item.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_invalid_url.rs b/tests/codegen/fail/scalar/derive_input/attr_invalid_url.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_invalid_url.rs rename to tests/codegen/fail/scalar/derive_input/attr_invalid_url.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_invalid_url.stderr b/tests/codegen/fail/scalar/derive_input/attr_invalid_url.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_invalid_url.stderr rename to tests/codegen/fail/scalar/derive_input/attr_invalid_url.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_and_with.rs b/tests/codegen/fail/scalar/derive_input/attr_transparent_and_with.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_and_with.rs rename to tests/codegen/fail/scalar/derive_input/attr_transparent_and_with.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_and_with.stderr b/tests/codegen/fail/scalar/derive_input/attr_transparent_and_with.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_and_with.stderr rename to tests/codegen/fail/scalar/derive_input/attr_transparent_and_with.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_named_fields.rs b/tests/codegen/fail/scalar/derive_input/attr_transparent_multiple_named_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_named_fields.rs rename to tests/codegen/fail/scalar/derive_input/attr_transparent_multiple_named_fields.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_named_fields.stderr b/tests/codegen/fail/scalar/derive_input/attr_transparent_multiple_named_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_named_fields.stderr rename to tests/codegen/fail/scalar/derive_input/attr_transparent_multiple_named_fields.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.rs b/tests/codegen/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.rs rename to tests/codegen/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.stderr b/tests/codegen/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.stderr rename to tests/codegen/fail/scalar/derive_input/attr_transparent_multiple_unnamed_fields.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_unit_struct.rs b/tests/codegen/fail/scalar/derive_input/attr_transparent_unit_struct.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_unit_struct.rs rename to tests/codegen/fail/scalar/derive_input/attr_transparent_unit_struct.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_unit_struct.stderr b/tests/codegen/fail/scalar/derive_input/attr_transparent_unit_struct.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/attr_transparent_unit_struct.stderr rename to tests/codegen/fail/scalar/derive_input/attr_transparent_unit_struct.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_invalid_url.rs b/tests/codegen/fail/scalar/derive_input/derive_invalid_url.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_invalid_url.rs rename to tests/codegen/fail/scalar/derive_input/derive_invalid_url.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_invalid_url.stderr b/tests/codegen/fail/scalar/derive_input/derive_invalid_url.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_invalid_url.stderr rename to tests/codegen/fail/scalar/derive_input/derive_invalid_url.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_and_with.rs b/tests/codegen/fail/scalar/derive_input/derive_transparent_and_with.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_and_with.rs rename to tests/codegen/fail/scalar/derive_input/derive_transparent_and_with.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_and_with.stderr b/tests/codegen/fail/scalar/derive_input/derive_transparent_and_with.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_and_with.stderr rename to tests/codegen/fail/scalar/derive_input/derive_transparent_and_with.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_named_fields.rs b/tests/codegen/fail/scalar/derive_input/derive_transparent_multiple_named_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_named_fields.rs rename to tests/codegen/fail/scalar/derive_input/derive_transparent_multiple_named_fields.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_named_fields.stderr b/tests/codegen/fail/scalar/derive_input/derive_transparent_multiple_named_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_named_fields.stderr rename to tests/codegen/fail/scalar/derive_input/derive_transparent_multiple_named_fields.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.rs b/tests/codegen/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.rs rename to tests/codegen/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.stderr b/tests/codegen/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.stderr rename to tests/codegen/fail/scalar/derive_input/derive_transparent_multiple_unnamed_fields.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_unit_struct.rs b/tests/codegen/fail/scalar/derive_input/derive_transparent_unit_struct.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_unit_struct.rs rename to tests/codegen/fail/scalar/derive_input/derive_transparent_unit_struct.rs diff --git a/integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_unit_struct.stderr b/tests/codegen/fail/scalar/derive_input/derive_transparent_unit_struct.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/derive_input/derive_transparent_unit_struct.stderr rename to tests/codegen/fail/scalar/derive_input/derive_transparent_unit_struct.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/type_alias/attr_invalid_url.rs b/tests/codegen/fail/scalar/type_alias/attr_invalid_url.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/type_alias/attr_invalid_url.rs rename to tests/codegen/fail/scalar/type_alias/attr_invalid_url.rs diff --git a/integration_tests/codegen_fail/fail/scalar/type_alias/attr_invalid_url.stderr b/tests/codegen/fail/scalar/type_alias/attr_invalid_url.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/type_alias/attr_invalid_url.stderr rename to tests/codegen/fail/scalar/type_alias/attr_invalid_url.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/type_alias/attr_with_not_all_resolvers.rs b/tests/codegen/fail/scalar/type_alias/attr_with_not_all_resolvers.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/type_alias/attr_with_not_all_resolvers.rs rename to tests/codegen/fail/scalar/type_alias/attr_with_not_all_resolvers.rs diff --git a/integration_tests/codegen_fail/fail/scalar/type_alias/attr_with_not_all_resolvers.stderr b/tests/codegen/fail/scalar/type_alias/attr_with_not_all_resolvers.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/type_alias/attr_with_not_all_resolvers.stderr rename to tests/codegen/fail/scalar/type_alias/attr_with_not_all_resolvers.stderr diff --git a/integration_tests/codegen_fail/fail/scalar/type_alias/attr_without_resolvers.rs b/tests/codegen/fail/scalar/type_alias/attr_without_resolvers.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/type_alias/attr_without_resolvers.rs rename to tests/codegen/fail/scalar/type_alias/attr_without_resolvers.rs diff --git a/integration_tests/codegen_fail/fail/scalar/type_alias/attr_without_resolvers.stderr b/tests/codegen/fail/scalar/type_alias/attr_without_resolvers.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar/type_alias/attr_without_resolvers.stderr rename to tests/codegen/fail/scalar/type_alias/attr_without_resolvers.stderr diff --git a/integration_tests/codegen_fail/fail/scalar_value/missing_attributes.rs b/tests/codegen/fail/scalar_value/missing_attributes.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar_value/missing_attributes.rs rename to tests/codegen/fail/scalar_value/missing_attributes.rs diff --git a/integration_tests/codegen_fail/fail/scalar_value/missing_attributes.stderr b/tests/codegen/fail/scalar_value/missing_attributes.stderr similarity index 71% rename from integration_tests/codegen_fail/fail/scalar_value/missing_attributes.stderr rename to tests/codegen/fail/scalar_value/missing_attributes.stderr index 1e0ff344..700a95fa 100644 --- a/integration_tests/codegen_fail/fail/scalar_value/missing_attributes.stderr +++ b/tests/codegen/fail/scalar_value/missing_attributes.stderr @@ -1,4 +1,4 @@ -error: GraphQL built-in scalars missing `#[value(as_int, as_float)]` attributes. In case you are sure that it\'s ok, use `#[value(allow_missing_attributes)]` to suppress this error. +error: GraphQL built-in scalars missing `#[value(as_int, as_float)]` attributes. In case you are sure that it's ok, use `#[value(allow_missing_attributes)]` to suppress this error. --> fail/scalar_value/missing_attributes.rs:4:1 | 4 | / pub enum DefaultScalarValue { diff --git a/integration_tests/codegen_fail/fail/scalar_value/multiple_named_fields.rs b/tests/codegen/fail/scalar_value/multiple_named_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar_value/multiple_named_fields.rs rename to tests/codegen/fail/scalar_value/multiple_named_fields.rs diff --git a/integration_tests/codegen_fail/fail/scalar_value/multiple_named_fields.stderr b/tests/codegen/fail/scalar_value/multiple_named_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar_value/multiple_named_fields.stderr rename to tests/codegen/fail/scalar_value/multiple_named_fields.stderr diff --git a/integration_tests/codegen_fail/fail/scalar_value/multiple_unnamed_fields.rs b/tests/codegen/fail/scalar_value/multiple_unnamed_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar_value/multiple_unnamed_fields.rs rename to tests/codegen/fail/scalar_value/multiple_unnamed_fields.rs diff --git a/integration_tests/codegen_fail/fail/scalar_value/multiple_unnamed_fields.stderr b/tests/codegen/fail/scalar_value/multiple_unnamed_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar_value/multiple_unnamed_fields.stderr rename to tests/codegen/fail/scalar_value/multiple_unnamed_fields.stderr diff --git a/integration_tests/codegen_fail/fail/scalar_value/not_enum.rs b/tests/codegen/fail/scalar_value/not_enum.rs similarity index 100% rename from integration_tests/codegen_fail/fail/scalar_value/not_enum.rs rename to tests/codegen/fail/scalar_value/not_enum.rs diff --git a/integration_tests/codegen_fail/fail/scalar_value/not_enum.stderr b/tests/codegen/fail/scalar_value/not_enum.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/scalar_value/not_enum.stderr rename to tests/codegen/fail/scalar_value/not_enum.stderr diff --git a/integration_tests/codegen_fail/fail/subscription/argument_double_underscored.rs b/tests/codegen/fail/subscription/argument_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/argument_double_underscored.rs rename to tests/codegen/fail/subscription/argument_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/subscription/argument_double_underscored.stderr b/tests/codegen/fail/subscription/argument_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/argument_double_underscored.stderr rename to tests/codegen/fail/subscription/argument_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/subscription/argument_non_input_type.rs b/tests/codegen/fail/subscription/argument_non_input_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/argument_non_input_type.rs rename to tests/codegen/fail/subscription/argument_non_input_type.rs diff --git a/integration_tests/codegen_fail/fail/subscription/argument_non_input_type.stderr b/tests/codegen/fail/subscription/argument_non_input_type.stderr similarity index 50% rename from integration_tests/codegen_fail/fail/subscription/argument_non_input_type.stderr rename to tests/codegen/fail/subscription/argument_non_input_type.stderr index 43d9b36d..f1f8538b 100644 --- a/integration_tests/codegen_fail/fail/subscription/argument_non_input_type.stderr +++ b/tests/codegen/fail/subscription/argument_non_input_type.stderr @@ -3,6 +3,17 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied | 17 | async fn id(&self, obj: ObjA) -> Stream<'static, &'static str> { | ^^^^ the trait `IsInputType<__S>` is not implemented for `ObjA` + | + = help: the following other types implement trait `IsInputType`: + <&T as IsInputType> + as IsInputType> + as IsInputType> + > + > + as IsInputType> + <[T; N] as IsInputType> + <[T] as IsInputType> + and 12 others error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied --> fail/subscription/argument_non_input_type.rs:15:1 @@ -10,6 +21,16 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied 15 | #[graphql_subscription] | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` | + = help: the following other types implement trait `FromInputValue`: + as FromInputValue> + as FromInputValue> + > + > + as FromInputValue> + <[T; N] as FromInputValue> + > + > + and 9 others note: required by a bound in `Registry::<'r, S>::arg` --> $WORKSPACE/juniper/src/executor/mod.rs | @@ -23,4 +44,14 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied 15 | #[graphql_subscription] | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromInputValue<__S>` is not implemented for `ObjA` | + = help: the following other types implement trait `FromInputValue`: + as FromInputValue> + as FromInputValue> + > + > + as FromInputValue> + <[T; N] as FromInputValue> + > + > + and 9 others = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.rs b/tests/codegen/fail/subscription/argument_wrong_default_array.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.rs rename to tests/codegen/fail/subscription/argument_wrong_default_array.rs diff --git a/integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.stderr b/tests/codegen/fail/subscription/argument_wrong_default_array.stderr similarity index 71% rename from integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.stderr rename to tests/codegen/fail/subscription/argument_wrong_default_array.stderr index eafad054..ea5ccd3c 100644 --- a/integration_tests/codegen_fail/fail/subscription/argument_wrong_default_array.stderr +++ b/tests/codegen/fail/subscription/argument_wrong_default_array.stderr @@ -4,11 +4,15 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied 10 | #[graphql_subscription] | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]` | - = help: the following implementations were found: + = help: the following other types implement trait `From`: <&'a [ascii::ascii_char::AsciiChar] as From<&'a ascii::ascii_str::AsciiStr>> <&'a [u32; 4] as From<&'a ppv_lite86::x86_64::vec128_storage>> <&'a [u8] as From<&'a ascii::ascii_str::AsciiStr>> <&'a mut [ascii::ascii_char::AsciiChar] as From<&'a mut ascii::ascii_str::AsciiStr>> - and 11 others + <[T; LANES] as From>> + <[bool; LANES] as From>> + <[u128; 1] as From> + <[u128; 2] as From> + and 7 others = note: required because of the requirements on the impl of `Into<[bool; 2]>` for `[bool; 3]` = note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/subscription/field_double_underscored.rs b/tests/codegen/fail/subscription/field_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/field_double_underscored.rs rename to tests/codegen/fail/subscription/field_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/subscription/field_double_underscored.stderr b/tests/codegen/fail/subscription/field_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/field_double_underscored.stderr rename to tests/codegen/fail/subscription/field_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.rs b/tests/codegen/fail/subscription/field_non_output_return_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/field_non_output_return_type.rs rename to tests/codegen/fail/subscription/field_non_output_return_type.rs diff --git a/tests/codegen/fail/subscription/field_non_output_return_type.stderr b/tests/codegen/fail/subscription/field_non_output_return_type.stderr new file mode 100644 index 00000000..9b5be8a7 --- /dev/null +++ b/tests/codegen/fail/subscription/field_non_output_return_type.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `ObjB: IsOutputType<__S>` is not satisfied + --> fail/subscription/field_non_output_return_type.rs:17:27 + | +17 | async fn id(&self) -> Stream<'static, ObjB> { + | ^^^^^^^^^^^^^^^^^^^^^ the trait `IsOutputType<__S>` is not implemented for `ObjB` + | + = help: the following other types implement trait `IsOutputType`: + <&T as IsOutputType> + as IsOutputType> + as IsOutputType> + > + > + > + as IsOutputType> + > + and 18 others diff --git a/integration_tests/codegen_fail/fail/subscription/field_not_async.rs b/tests/codegen/fail/subscription/field_not_async.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/field_not_async.rs rename to tests/codegen/fail/subscription/field_not_async.rs diff --git a/integration_tests/codegen_fail/fail/subscription/field_not_async.stderr b/tests/codegen/fail/subscription/field_not_async.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/field_not_async.stderr rename to tests/codegen/fail/subscription/field_not_async.stderr diff --git a/integration_tests/codegen_fail/fail/subscription/fields_duplicate.rs b/tests/codegen/fail/subscription/fields_duplicate.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/fields_duplicate.rs rename to tests/codegen/fail/subscription/fields_duplicate.rs diff --git a/integration_tests/codegen_fail/fail/subscription/fields_duplicate.stderr b/tests/codegen/fail/subscription/fields_duplicate.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/fields_duplicate.stderr rename to tests/codegen/fail/subscription/fields_duplicate.stderr diff --git a/integration_tests/codegen_fail/fail/subscription/name_double_underscored.rs b/tests/codegen/fail/subscription/name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/name_double_underscored.rs rename to tests/codegen/fail/subscription/name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/subscription/name_double_underscored.stderr b/tests/codegen/fail/subscription/name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/name_double_underscored.stderr rename to tests/codegen/fail/subscription/name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/subscription/no_fields.rs b/tests/codegen/fail/subscription/no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/no_fields.rs rename to tests/codegen/fail/subscription/no_fields.rs diff --git a/integration_tests/codegen_fail/fail/subscription/no_fields.stderr b/tests/codegen/fail/subscription/no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/no_fields.stderr rename to tests/codegen/fail/subscription/no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/subscription/wrong_item.rs b/tests/codegen/fail/subscription/wrong_item.rs similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/wrong_item.rs rename to tests/codegen/fail/subscription/wrong_item.rs diff --git a/integration_tests/codegen_fail/fail/subscription/wrong_item.stderr b/tests/codegen/fail/subscription/wrong_item.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/subscription/wrong_item.stderr rename to tests/codegen/fail/subscription/wrong_item.stderr diff --git a/integration_tests/codegen_fail/fail/union/attr_wrong_item.rs b/tests/codegen/fail/union/attr_wrong_item.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/attr_wrong_item.rs rename to tests/codegen/fail/union/attr_wrong_item.rs diff --git a/integration_tests/codegen_fail/fail/union/attr_wrong_item.stderr b/tests/codegen/fail/union/attr_wrong_item.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/attr_wrong_item.stderr rename to tests/codegen/fail/union/attr_wrong_item.stderr diff --git a/integration_tests/codegen_fail/fail/union/derive_wrong_item.rs b/tests/codegen/fail/union/derive_wrong_item.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/derive_wrong_item.rs rename to tests/codegen/fail/union/derive_wrong_item.rs diff --git a/integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr b/tests/codegen/fail/union/derive_wrong_item.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/derive_wrong_item.stderr rename to tests/codegen/fail/union/derive_wrong_item.stderr diff --git a/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.rs b/tests/codegen/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.rs rename to tests/codegen/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.rs diff --git a/integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr b/tests/codegen/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr rename to tests/codegen/fail/union/enum_external_resolver_fn_conflicts_with_variant_external_resolver_fn.stderr diff --git a/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.rs b/tests/codegen/fail/union/enum_name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_name_double_underscored.rs rename to tests/codegen/fail/union/enum_name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr b/tests/codegen/fail/union/enum_name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_name_double_underscored.stderr rename to tests/codegen/fail/union/enum_name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/union/enum_no_fields.rs b/tests/codegen/fail/union/enum_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_no_fields.rs rename to tests/codegen/fail/union/enum_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/union/enum_no_fields.stderr b/tests/codegen/fail/union/enum_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_no_fields.stderr rename to tests/codegen/fail/union/enum_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.rs b/tests/codegen/fail/union/enum_non_object_variant.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_non_object_variant.rs rename to tests/codegen/fail/union/enum_non_object_variant.rs diff --git a/tests/codegen/fail/union/enum_non_object_variant.stderr b/tests/codegen/fail/union/enum_non_object_variant.stderr new file mode 100644 index 00000000..7b047248 --- /dev/null +++ b/tests/codegen/fail/union/enum_non_object_variant.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied + --> fail/union/enum_non_object_variant.rs:9:10 + | +9 | #[derive(GraphQLUnion)] + | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = help: the following other types implement trait `GraphQLObject`: + <&T as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + > + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.rs b/tests/codegen/fail/union/enum_same_type_pretty.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_same_type_pretty.rs rename to tests/codegen/fail/union/enum_same_type_pretty.rs diff --git a/integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr b/tests/codegen/fail/union/enum_same_type_pretty.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_same_type_pretty.stderr rename to tests/codegen/fail/union/enum_same_type_pretty.stderr diff --git a/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.rs b/tests/codegen/fail/union/enum_same_type_ugly.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_same_type_ugly.rs rename to tests/codegen/fail/union/enum_same_type_ugly.rs diff --git a/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr b/tests/codegen/fail/union/enum_same_type_ugly.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr rename to tests/codegen/fail/union/enum_same_type_ugly.stderr diff --git a/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.rs b/tests/codegen/fail/union/enum_wrong_variant_field.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.rs rename to tests/codegen/fail/union/enum_wrong_variant_field.rs diff --git a/integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr b/tests/codegen/fail/union/enum_wrong_variant_field.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/enum_wrong_variant_field.stderr rename to tests/codegen/fail/union/enum_wrong_variant_field.stderr diff --git a/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.rs b/tests/codegen/fail/union/struct_name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_name_double_underscored.rs rename to tests/codegen/fail/union/struct_name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr b/tests/codegen/fail/union/struct_name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_name_double_underscored.stderr rename to tests/codegen/fail/union/struct_name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/union/struct_no_fields.rs b/tests/codegen/fail/union/struct_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_no_fields.rs rename to tests/codegen/fail/union/struct_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/union/struct_no_fields.stderr b/tests/codegen/fail/union/struct_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_no_fields.stderr rename to tests/codegen/fail/union/struct_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.rs b/tests/codegen/fail/union/struct_non_object_variant.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_non_object_variant.rs rename to tests/codegen/fail/union/struct_non_object_variant.rs diff --git a/tests/codegen/fail/union/struct_non_object_variant.stderr b/tests/codegen/fail/union/struct_non_object_variant.stderr new file mode 100644 index 00000000..cd909028 --- /dev/null +++ b/tests/codegen/fail/union/struct_non_object_variant.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied + --> fail/union/struct_non_object_variant.rs:9:10 + | +9 | #[derive(GraphQLUnion)] + | ^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = help: the following other types implement trait `GraphQLObject`: + <&T as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + > + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + = note: this error originates in the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/struct_same_type_pretty.rs b/tests/codegen/fail/union/struct_same_type_pretty.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_same_type_pretty.rs rename to tests/codegen/fail/union/struct_same_type_pretty.rs diff --git a/integration_tests/codegen_fail/fail/union/struct_same_type_pretty.stderr b/tests/codegen/fail/union/struct_same_type_pretty.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_same_type_pretty.stderr rename to tests/codegen/fail/union/struct_same_type_pretty.stderr diff --git a/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.rs b/tests/codegen/fail/union/struct_same_type_ugly.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_same_type_ugly.rs rename to tests/codegen/fail/union/struct_same_type_ugly.rs diff --git a/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr b/tests/codegen/fail/union/struct_same_type_ugly.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr rename to tests/codegen/fail/union/struct_same_type_ugly.stderr diff --git a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.rs b/tests/codegen/fail/union/trait_fail_infer_context.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_fail_infer_context.rs rename to tests/codegen/fail/union/trait_fail_infer_context.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr b/tests/codegen/fail/union/trait_fail_infer_context.stderr similarity index 83% rename from integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr rename to tests/codegen/fail/union/trait_fail_infer_context.stderr index 87258824..49a39cc4 100644 --- a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr +++ b/tests/codegen/fail/union/trait_fail_infer_context.stderr @@ -4,6 +4,9 @@ error[E0277]: the trait bound `CustomContext: FromContext` is not sa 3 | #[graphql_union] | ^^^^^^^^^^^^^^^^ the trait `FromContext` is not implemented for `CustomContext` | + = help: the following other types implement trait `FromContext`: + <() as FromContext> + > = note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types diff --git a/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.rs b/tests/codegen/fail/union/trait_method_conflicts_with_external_resolver_fn.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.rs rename to tests/codegen/fail/union/trait_method_conflicts_with_external_resolver_fn.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr b/tests/codegen/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr rename to tests/codegen/fail/union/trait_method_conflicts_with_external_resolver_fn.stderr diff --git a/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.rs b/tests/codegen/fail/union/trait_name_double_underscored.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_name_double_underscored.rs rename to tests/codegen/fail/union/trait_name_double_underscored.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr b/tests/codegen/fail/union/trait_name_double_underscored.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_name_double_underscored.stderr rename to tests/codegen/fail/union/trait_name_double_underscored.stderr diff --git a/integration_tests/codegen_fail/fail/union/trait_no_fields.rs b/tests/codegen/fail/union/trait_no_fields.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_no_fields.rs rename to tests/codegen/fail/union/trait_no_fields.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_no_fields.stderr b/tests/codegen/fail/union/trait_no_fields.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_no_fields.stderr rename to tests/codegen/fail/union/trait_no_fields.stderr diff --git a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.rs b/tests/codegen/fail/union/trait_non_object_variant.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_non_object_variant.rs rename to tests/codegen/fail/union/trait_non_object_variant.rs diff --git a/tests/codegen/fail/union/trait_non_object_variant.stderr b/tests/codegen/fail/union/trait_non_object_variant.stderr new file mode 100644 index 00000000..4783de9f --- /dev/null +++ b/tests/codegen/fail/union/trait_non_object_variant.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `Test: GraphQLObject<__S>` is not satisfied + --> fail/union/trait_non_object_variant.rs:9:1 + | +9 | #[graphql_union] + | ^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `Test` + | + = help: the following other types implement trait `GraphQLObject`: + <&T as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + > + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + as GraphQLObject> + = note: this error originates in the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.rs b/tests/codegen/fail/union/trait_same_type_pretty.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_same_type_pretty.rs rename to tests/codegen/fail/union/trait_same_type_pretty.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr b/tests/codegen/fail/union/trait_same_type_pretty.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_same_type_pretty.stderr rename to tests/codegen/fail/union/trait_same_type_pretty.stderr diff --git a/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.rs b/tests/codegen/fail/union/trait_same_type_ugly.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_same_type_ugly.rs rename to tests/codegen/fail/union/trait_same_type_ugly.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr b/tests/codegen/fail/union/trait_same_type_ugly.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr rename to tests/codegen/fail/union/trait_same_type_ugly.stderr diff --git a/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.rs b/tests/codegen/fail/union/trait_with_attr_on_method.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.rs rename to tests/codegen/fail/union/trait_with_attr_on_method.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr b/tests/codegen/fail/union/trait_with_attr_on_method.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_with_attr_on_method.stderr rename to tests/codegen/fail/union/trait_with_attr_on_method.stderr diff --git a/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.rs b/tests/codegen/fail/union/trait_wrong_method_input_args.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.rs rename to tests/codegen/fail/union/trait_wrong_method_input_args.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr b/tests/codegen/fail/union/trait_wrong_method_input_args.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_wrong_method_input_args.stderr rename to tests/codegen/fail/union/trait_wrong_method_input_args.stderr diff --git a/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.rs b/tests/codegen/fail/union/trait_wrong_method_return_type.rs similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.rs rename to tests/codegen/fail/union/trait_wrong_method_return_type.rs diff --git a/integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr b/tests/codegen/fail/union/trait_wrong_method_return_type.stderr similarity index 100% rename from integration_tests/codegen_fail/fail/union/trait_wrong_method_return_type.stderr rename to tests/codegen/fail/union/trait_wrong_method_return_type.stderr diff --git a/integration_tests/codegen_fail/src/lib.rs b/tests/codegen/src/lib.rs similarity index 100% rename from integration_tests/codegen_fail/src/lib.rs rename to tests/codegen/src/lib.rs diff --git a/integration_tests/juniper_tests/Cargo.toml b/tests/integration/Cargo.toml similarity index 74% rename from integration_tests/juniper_tests/Cargo.toml rename to tests/integration/Cargo.toml index d037598b..2b2c3cc7 100644 --- a/integration_tests/juniper_tests/Cargo.toml +++ b/tests/integration/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "juniper_tests" -version = "0.1.0" +name = "juniper_integration_tests" +version = "0.0.0" edition = "2018" publish = false @@ -13,7 +13,7 @@ juniper_subscriptions = { path = "../../juniper_subscriptions" } [dev-dependencies] async-trait = "0.1.39" +fnv = "1.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -fnv = "1.0" -tokio = { version = "1", features = ["rt", "macros", "time"] } +tokio = { version = "1.0", features = ["rt", "macros", "time"] } diff --git a/integration_tests/juniper_tests/src/arc_fields.rs b/tests/integration/src/arc_fields.rs similarity index 100% rename from integration_tests/juniper_tests/src/arc_fields.rs rename to tests/integration/src/arc_fields.rs diff --git a/integration_tests/juniper_tests/src/array.rs b/tests/integration/src/array.rs similarity index 100% rename from integration_tests/juniper_tests/src/array.rs rename to tests/integration/src/array.rs diff --git a/integration_tests/juniper_tests/src/codegen/derive_enum.rs b/tests/integration/src/codegen/derive_enum.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/derive_enum.rs rename to tests/integration/src/codegen/derive_enum.rs diff --git a/integration_tests/juniper_tests/src/codegen/derive_input_object.rs b/tests/integration/src/codegen/derive_input_object.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/derive_input_object.rs rename to tests/integration/src/codegen/derive_input_object.rs diff --git a/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs b/tests/integration/src/codegen/derive_object_with_raw_idents.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs rename to tests/integration/src/codegen/derive_object_with_raw_idents.rs diff --git a/integration_tests/juniper_tests/src/codegen/interface_attr_struct.rs b/tests/integration/src/codegen/interface_attr_struct.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/interface_attr_struct.rs rename to tests/integration/src/codegen/interface_attr_struct.rs diff --git a/integration_tests/juniper_tests/src/codegen/interface_attr_trait.rs b/tests/integration/src/codegen/interface_attr_trait.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/interface_attr_trait.rs rename to tests/integration/src/codegen/interface_attr_trait.rs diff --git a/integration_tests/juniper_tests/src/codegen/interface_derive.rs b/tests/integration/src/codegen/interface_derive.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/interface_derive.rs rename to tests/integration/src/codegen/interface_derive.rs diff --git a/integration_tests/juniper_tests/src/codegen/mod.rs b/tests/integration/src/codegen/mod.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/mod.rs rename to tests/integration/src/codegen/mod.rs diff --git a/integration_tests/juniper_tests/src/codegen/object_attr.rs b/tests/integration/src/codegen/object_attr.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/object_attr.rs rename to tests/integration/src/codegen/object_attr.rs diff --git a/integration_tests/juniper_tests/src/codegen/object_derive.rs b/tests/integration/src/codegen/object_derive.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/object_derive.rs rename to tests/integration/src/codegen/object_derive.rs diff --git a/integration_tests/juniper_tests/src/codegen/scalar_attr_derive_input.rs b/tests/integration/src/codegen/scalar_attr_derive_input.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/scalar_attr_derive_input.rs rename to tests/integration/src/codegen/scalar_attr_derive_input.rs diff --git a/integration_tests/juniper_tests/src/codegen/scalar_attr_type_alias.rs b/tests/integration/src/codegen/scalar_attr_type_alias.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/scalar_attr_type_alias.rs rename to tests/integration/src/codegen/scalar_attr_type_alias.rs diff --git a/integration_tests/juniper_tests/src/codegen/scalar_derive.rs b/tests/integration/src/codegen/scalar_derive.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/scalar_derive.rs rename to tests/integration/src/codegen/scalar_derive.rs diff --git a/integration_tests/juniper_tests/src/codegen/scalar_value_derive.rs b/tests/integration/src/codegen/scalar_value_derive.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/scalar_value_derive.rs rename to tests/integration/src/codegen/scalar_value_derive.rs diff --git a/integration_tests/juniper_tests/src/codegen/subscription_attr.rs b/tests/integration/src/codegen/subscription_attr.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/subscription_attr.rs rename to tests/integration/src/codegen/subscription_attr.rs diff --git a/integration_tests/juniper_tests/src/codegen/union_attr.rs b/tests/integration/src/codegen/union_attr.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/union_attr.rs rename to tests/integration/src/codegen/union_attr.rs diff --git a/integration_tests/juniper_tests/src/codegen/union_derive.rs b/tests/integration/src/codegen/union_derive.rs similarity index 100% rename from integration_tests/juniper_tests/src/codegen/union_derive.rs rename to tests/integration/src/codegen/union_derive.rs diff --git a/integration_tests/juniper_tests/src/custom_scalar.rs b/tests/integration/src/custom_scalar.rs similarity index 100% rename from integration_tests/juniper_tests/src/custom_scalar.rs rename to tests/integration/src/custom_scalar.rs diff --git a/integration_tests/juniper_tests/src/explicit_null.rs b/tests/integration/src/explicit_null.rs similarity index 100% rename from integration_tests/juniper_tests/src/explicit_null.rs rename to tests/integration/src/explicit_null.rs diff --git a/integration_tests/juniper_tests/src/infallible_as_field_error.rs b/tests/integration/src/infallible_as_field_error.rs similarity index 100% rename from integration_tests/juniper_tests/src/infallible_as_field_error.rs rename to tests/integration/src/infallible_as_field_error.rs diff --git a/integration_tests/juniper_tests/src/issue_371.rs b/tests/integration/src/issue_371.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_371.rs rename to tests/integration/src/issue_371.rs diff --git a/integration_tests/juniper_tests/src/issue_372.rs b/tests/integration/src/issue_372.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_372.rs rename to tests/integration/src/issue_372.rs diff --git a/integration_tests/juniper_tests/src/issue_398.rs b/tests/integration/src/issue_398.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_398.rs rename to tests/integration/src/issue_398.rs diff --git a/integration_tests/juniper_tests/src/issue_407.rs b/tests/integration/src/issue_407.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_407.rs rename to tests/integration/src/issue_407.rs diff --git a/integration_tests/juniper_tests/src/issue_500.rs b/tests/integration/src/issue_500.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_500.rs rename to tests/integration/src/issue_500.rs diff --git a/integration_tests/juniper_tests/src/issue_798.rs b/tests/integration/src/issue_798.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_798.rs rename to tests/integration/src/issue_798.rs diff --git a/integration_tests/juniper_tests/src/issue_914.rs b/tests/integration/src/issue_914.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_914.rs rename to tests/integration/src/issue_914.rs diff --git a/integration_tests/juniper_tests/src/issue_922.rs b/tests/integration/src/issue_922.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_922.rs rename to tests/integration/src/issue_922.rs diff --git a/integration_tests/juniper_tests/src/issue_925.rs b/tests/integration/src/issue_925.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_925.rs rename to tests/integration/src/issue_925.rs diff --git a/integration_tests/juniper_tests/src/issue_945.rs b/tests/integration/src/issue_945.rs similarity index 100% rename from integration_tests/juniper_tests/src/issue_945.rs rename to tests/integration/src/issue_945.rs diff --git a/integration_tests/juniper_tests/src/lib.rs b/tests/integration/src/lib.rs similarity index 100% rename from integration_tests/juniper_tests/src/lib.rs rename to tests/integration/src/lib.rs diff --git a/integration_tests/juniper_tests/src/pre_parse.rs b/tests/integration/src/pre_parse.rs similarity index 100% rename from integration_tests/juniper_tests/src/pre_parse.rs rename to tests/integration/src/pre_parse.rs