@nestjs/apollo 13.4.0 → 13.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drivers/apollo-base.driver.js +1 -1
- package/dist/drivers/apollo-gateway.driver.d.ts +1 -0
- package/dist/drivers/apollo-gateway.driver.d.ts.map +1 -1
- package/dist/drivers/apollo-gateway.driver.js +38 -2
- package/dist/interfaces/apollo-driver-config.interface.d.ts +14 -0
- package/dist/interfaces/apollo-driver-config.interface.d.ts.map +1 -1
- package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts +13 -0
- package/dist/interfaces/apollo-gateway-driver-config.interface.d.ts.map +1 -1
- package/dist/tests/lib/constants/apollo.constants.d.ts +2 -0
- package/dist/tests/lib/constants/apollo.constants.d.ts.map +1 -0
- package/dist/tests/lib/constants/apollo.constants.js +4 -0
- package/dist/tests/lib/constants/index.d.ts +2 -0
- package/dist/tests/lib/constants/index.d.ts.map +1 -0
- package/dist/tests/lib/constants/index.js +4 -0
- package/dist/tests/lib/decorators/index.d.ts +2 -0
- package/dist/tests/lib/decorators/index.d.ts.map +1 -0
- package/dist/tests/lib/decorators/index.js +4 -0
- package/dist/tests/lib/decorators/plugin.decorator.d.ts +7 -0
- package/dist/tests/lib/decorators/plugin.decorator.d.ts.map +1 -0
- package/dist/tests/lib/decorators/plugin.decorator.js +15 -0
- package/dist/tests/lib/drivers/apollo-base.driver.d.ts +23 -0
- package/dist/tests/lib/drivers/apollo-base.driver.d.ts.map +1 -0
- package/dist/tests/lib/drivers/apollo-base.driver.js +262 -0
- package/dist/tests/lib/drivers/apollo-federation.driver.d.ts +17 -0
- package/dist/tests/lib/drivers/apollo-federation.driver.d.ts.map +1 -0
- package/dist/tests/lib/drivers/apollo-federation.driver.js +46 -0
- package/dist/tests/lib/drivers/apollo-gateway.driver.d.ts +15 -0
- package/dist/tests/lib/drivers/apollo-gateway.driver.d.ts.map +1 -0
- package/dist/tests/lib/drivers/apollo-gateway.driver.js +80 -0
- package/dist/tests/lib/drivers/apollo.driver.d.ts +15 -0
- package/dist/tests/lib/drivers/apollo.driver.d.ts.map +1 -0
- package/dist/tests/lib/drivers/apollo.driver.js +57 -0
- package/dist/tests/lib/drivers/index.d.ts +4 -0
- package/dist/tests/lib/drivers/index.d.ts.map +1 -0
- package/dist/tests/lib/drivers/index.js +6 -0
- package/dist/tests/lib/errors/authentication.error.d.ts +14 -0
- package/dist/tests/lib/errors/authentication.error.d.ts.map +1 -0
- package/dist/tests/lib/errors/authentication.error.js +25 -0
- package/dist/tests/lib/errors/forbidden.error.d.ts +14 -0
- package/dist/tests/lib/errors/forbidden.error.d.ts.map +1 -0
- package/dist/tests/lib/errors/forbidden.error.js +25 -0
- package/dist/tests/lib/errors/index.d.ts +5 -0
- package/dist/tests/lib/errors/index.d.ts.map +1 -0
- package/dist/tests/lib/errors/index.js +7 -0
- package/dist/tests/lib/errors/user-input.error.d.ts +14 -0
- package/dist/tests/lib/errors/user-input.error.d.ts.map +1 -0
- package/dist/tests/lib/errors/user-input.error.js +26 -0
- package/dist/tests/lib/errors/validation.error.d.ts +14 -0
- package/dist/tests/lib/errors/validation.error.d.ts.map +1 -0
- package/dist/tests/lib/errors/validation.error.js +26 -0
- package/dist/tests/lib/graphiql/graphiql-html.factory.d.ts +5 -0
- package/dist/tests/lib/graphiql/graphiql-html.factory.d.ts.map +1 -0
- package/dist/tests/lib/graphiql/graphiql-html.factory.js +69 -0
- package/dist/tests/lib/graphiql/graphiql-playground.plugin.d.ts +13 -0
- package/dist/tests/lib/graphiql/graphiql-playground.plugin.d.ts.map +1 -0
- package/dist/tests/lib/graphiql/graphiql-playground.plugin.js +19 -0
- package/dist/tests/lib/graphiql/interfaces/graphiql-options.interface.d.ts +33 -0
- package/dist/tests/lib/graphiql/interfaces/graphiql-options.interface.d.ts.map +1 -0
- package/dist/tests/lib/graphiql/interfaces/graphiql-options.interface.js +2 -0
- package/dist/tests/lib/index.d.ts +7 -0
- package/dist/tests/lib/index.d.ts.map +1 -0
- package/dist/tests/lib/index.js +9 -0
- package/dist/tests/lib/interfaces/apollo-driver-config.interface.d.ts +44 -0
- package/dist/tests/lib/interfaces/apollo-driver-config.interface.d.ts.map +1 -0
- package/dist/tests/lib/interfaces/apollo-driver-config.interface.js +2 -0
- package/dist/tests/lib/interfaces/apollo-federation-driver-config.interface.d.ts +5 -0
- package/dist/tests/lib/interfaces/apollo-federation-driver-config.interface.d.ts.map +1 -0
- package/dist/tests/lib/interfaces/apollo-federation-driver-config.interface.js +2 -0
- package/dist/tests/lib/interfaces/apollo-gateway-driver-config.interface.d.ts +37 -0
- package/dist/tests/lib/interfaces/apollo-gateway-driver-config.interface.d.ts.map +1 -0
- package/dist/tests/lib/interfaces/apollo-gateway-driver-config.interface.js +2 -0
- package/dist/tests/lib/interfaces/index.d.ts +4 -0
- package/dist/tests/lib/interfaces/index.d.ts.map +1 -0
- package/dist/tests/lib/interfaces/index.js +6 -0
- package/dist/tests/lib/services/index.d.ts +2 -0
- package/dist/tests/lib/services/index.d.ts.map +1 -0
- package/dist/tests/lib/services/index.js +4 -0
- package/dist/tests/lib/services/plugins-explorer.service.d.ts +10 -0
- package/dist/tests/lib/services/plugins-explorer.service.d.ts.map +1 -0
- package/dist/tests/lib/services/plugins-explorer.service.js +24 -0
- package/dist/tests/lib/utils/async-iterator.util.d.ts +9 -0
- package/dist/tests/lib/utils/async-iterator.util.d.ts.map +1 -0
- package/dist/tests/lib/utils/async-iterator.util.js +60 -0
- package/dist/tests/lib/utils/get-apollo-server.d.ts +11 -0
- package/dist/tests/lib/utils/get-apollo-server.d.ts.map +1 -0
- package/dist/tests/lib/utils/get-apollo-server.js +20 -0
- package/dist/tests/lib/utils/index.d.ts +2 -0
- package/dist/tests/lib/utils/index.d.ts.map +1 -0
- package/dist/tests/lib/utils/index.js +4 -0
- package/dist/tests/tests/code-first/app.module.d.ts +3 -0
- package/dist/tests/tests/code-first/app.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first/app.module.js +26 -0
- package/dist/tests/tests/code-first/cats/cats.module.d.ts +23 -0
- package/dist/tests/tests/code-first/cats/cats.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first/cats/cats.module.js +50 -0
- package/dist/tests/tests/code-first/cats/cats.resolver.d.ts +4 -0
- package/dist/tests/tests/code-first/cats/cats.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first/cats/cats.resolver.js +20 -0
- package/dist/tests/tests/code-first/common/filters/unauthorized.filter.d.ts +6 -0
- package/dist/tests/tests/code-first/common/filters/unauthorized.filter.d.ts.map +1 -0
- package/dist/tests/tests/code-first/common/filters/unauthorized.filter.js +15 -0
- package/dist/tests/tests/code-first/common/guards/auth.guard.d.ts +5 -0
- package/dist/tests/tests/code-first/common/guards/auth.guard.d.ts.map +1 -0
- package/dist/tests/tests/code-first/common/guards/auth.guard.js +19 -0
- package/dist/tests/tests/code-first/common/scalars/date.scalar.d.ts +8 -0
- package/dist/tests/tests/code-first/common/scalars/date.scalar.d.ts.map +1 -0
- package/dist/tests/tests/code-first/common/scalars/date.scalar.js +27 -0
- package/dist/tests/tests/code-first/directions/directions.module.d.ts +3 -0
- package/dist/tests/tests/code-first/directions/directions.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first/directions/directions.module.js +14 -0
- package/dist/tests/tests/code-first/directions/directions.resolver.d.ts +5 -0
- package/dist/tests/tests/code-first/directions/directions.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first/directions/directions.resolver.js +22 -0
- package/dist/tests/tests/code-first/enums/direction.enum.d.ts +8 -0
- package/dist/tests/tests/code-first/enums/direction.enum.d.ts.map +1 -0
- package/dist/tests/tests/code-first/enums/direction.enum.js +24 -0
- package/dist/tests/tests/code-first/enums/sample-orphaned.enum.d.ts +7 -0
- package/dist/tests/tests/code-first/enums/sample-orphaned.enum.d.ts.map +1 -0
- package/dist/tests/tests/code-first/enums/sample-orphaned.enum.js +15 -0
- package/dist/tests/tests/code-first/main.d.ts +2 -0
- package/dist/tests/tests/code-first/main.d.ts.map +1 -0
- package/dist/tests/tests/code-first/main.js +11 -0
- package/dist/tests/tests/code-first/other/abstract.resolver.d.ts +6 -0
- package/dist/tests/tests/code-first/other/abstract.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first/other/abstract.resolver.js +23 -0
- package/dist/tests/tests/code-first/other/sample-orphaned.type.d.ts +8 -0
- package/dist/tests/tests/code-first/other/sample-orphaned.type.d.ts.map +1 -0
- package/dist/tests/tests/code-first/other/sample-orphaned.type.js +35 -0
- package/dist/tests/tests/code-first/other/sample-scalar.d.ts +8 -0
- package/dist/tests/tests/code-first/other/sample-scalar.d.ts.map +1 -0
- package/dist/tests/tests/code-first/other/sample-scalar.js +33 -0
- package/dist/tests/tests/code-first/recipes/dto/filter-recipes-count.args.d.ts +5 -0
- package/dist/tests/tests/code-first/recipes/dto/filter-recipes-count.args.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/dto/filter-recipes-count.args.js +19 -0
- package/dist/tests/tests/code-first/recipes/dto/new-recipe.input.d.ts +7 -0
- package/dist/tests/tests/code-first/recipes/dto/new-recipe.input.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/dto/new-recipe.input.js +32 -0
- package/dist/tests/tests/code-first/recipes/dto/recipes.args.d.ts +5 -0
- package/dist/tests/tests/code-first/recipes/dto/recipes.args.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/dto/recipes.args.js +30 -0
- package/dist/tests/tests/code-first/recipes/ingredients.resolver.d.ts +7 -0
- package/dist/tests/tests/code-first/recipes/ingredients.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/ingredients.resolver.js +42 -0
- package/dist/tests/tests/code-first/recipes/irecipes.resolver.d.ts +4 -0
- package/dist/tests/tests/code-first/recipes/irecipes.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/irecipes.resolver.js +22 -0
- package/dist/tests/tests/code-first/recipes/models/category.d.ts +7 -0
- package/dist/tests/tests/code-first/recipes/models/category.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/models/category.js +27 -0
- package/dist/tests/tests/code-first/recipes/models/ingredient.d.ts +12 -0
- package/dist/tests/tests/code-first/recipes/models/ingredient.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/models/ingredient.js +49 -0
- package/dist/tests/tests/code-first/recipes/models/recipe.d.ts +29 -0
- package/dist/tests/tests/code-first/recipes/models/recipe.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/models/recipe.js +80 -0
- package/dist/tests/tests/code-first/recipes/recipes.module.d.ts +3 -0
- package/dist/tests/tests/code-first/recipes/recipes.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/recipes.module.js +30 -0
- package/dist/tests/tests/code-first/recipes/recipes.resolver.d.ts +23 -0
- package/dist/tests/tests/code-first/recipes/recipes.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/recipes.resolver.js +141 -0
- package/dist/tests/tests/code-first/recipes/recipes.service.d.ts +15 -0
- package/dist/tests/tests/code-first/recipes/recipes.service.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/recipes.service.js +44 -0
- package/dist/tests/tests/code-first/recipes/unions/search-result.union.d.ts +4 -0
- package/dist/tests/tests/code-first/recipes/unions/search-result.union.d.ts.map +1 -0
- package/dist/tests/tests/code-first/recipes/unions/search-result.union.js +20 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/app.module.d.ts +3 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/app.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/app.module.js +28 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-a/module-a.module.d.ts +3 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-a/module-a.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-a/module-a.module.js +16 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-a/user.resolver.d.ts +4 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-a/user.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-a/user.resolver.js +21 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-b/module-b.module.d.ts +3 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-b/module-b.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-b/module-b.module.js +16 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-b/user.resolver.d.ts +4 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-b/user.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/module-b/user.resolver.js +21 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/query.resolver.d.ts +4 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/query.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-duplicate-resolvers/query.resolver.js +20 -0
- package/dist/tests/tests/code-first-federation/app.module.d.ts +3 -0
- package/dist/tests/tests/code-first-federation/app.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/app.module.js +36 -0
- package/dist/tests/tests/code-first-federation/caching.module.d.ts +3 -0
- package/dist/tests/tests/code-first-federation/caching.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/caching.module.js +59 -0
- package/dist/tests/tests/code-first-federation/human/character.entity.d.ts +5 -0
- package/dist/tests/tests/code-first-federation/human/character.entity.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/human/character.entity.js +19 -0
- package/dist/tests/tests/code-first-federation/human/human.entity.d.ts +6 -0
- package/dist/tests/tests/code-first-federation/human/human.entity.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/human/human.entity.js +14 -0
- package/dist/tests/tests/code-first-federation/human/human.module.d.ts +3 -0
- package/dist/tests/tests/code-first-federation/human/human.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/human/human.module.js +14 -0
- package/dist/tests/tests/code-first-federation/human/human.resolver.d.ts +6 -0
- package/dist/tests/tests/code-first-federation/human/human.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/human/human.resolver.js +34 -0
- package/dist/tests/tests/code-first-federation/main.d.ts +2 -0
- package/dist/tests/tests/code-first-federation/main.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/main.js +11 -0
- package/dist/tests/tests/code-first-federation/post/post.entity.d.ts +7 -0
- package/dist/tests/tests/code-first-federation/post/post.entity.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/post/post.entity.js +28 -0
- package/dist/tests/tests/code-first-federation/post/post.module.d.ts +3 -0
- package/dist/tests/tests/code-first-federation/post/post.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/post/post.module.js +16 -0
- package/dist/tests/tests/code-first-federation/post/post.resolver.d.ts +12 -0
- package/dist/tests/tests/code-first-federation/post/post.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/post/post.resolver.js +61 -0
- package/dist/tests/tests/code-first-federation/post/post.service.d.ts +7 -0
- package/dist/tests/tests/code-first-federation/post/post.service.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/post/post.service.js +37 -0
- package/dist/tests/tests/code-first-federation/recipe/irecipe.resolver.d.ts +8 -0
- package/dist/tests/tests/code-first-federation/recipe/irecipe.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/recipe/irecipe.resolver.js +21 -0
- package/dist/tests/tests/code-first-federation/recipe/recipe.d.ts +11 -0
- package/dist/tests/tests/code-first-federation/recipe/recipe.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/recipe/recipe.js +44 -0
- package/dist/tests/tests/code-first-federation/recipe/recipe.module.d.ts +3 -0
- package/dist/tests/tests/code-first-federation/recipe/recipe.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/recipe/recipe.module.js +14 -0
- package/dist/tests/tests/code-first-federation/unions/search-result.union.d.ts +4 -0
- package/dist/tests/tests/code-first-federation/unions/search-result.union.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/unions/search-result.union.js +20 -0
- package/dist/tests/tests/code-first-federation/user/user.entity.d.ts +7 -0
- package/dist/tests/tests/code-first-federation/user/user.entity.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/user/user.entity.js +27 -0
- package/dist/tests/tests/code-first-federation/user/user.module.d.ts +3 -0
- package/dist/tests/tests/code-first-federation/user/user.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/user/user.module.js +16 -0
- package/dist/tests/tests/code-first-federation/user/user.resolver.d.ts +8 -0
- package/dist/tests/tests/code-first-federation/user/user.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-federation/user/user.resolver.js +27 -0
- package/dist/tests/tests/code-first-register-in/products/product.model.d.ts +5 -0
- package/dist/tests/tests/code-first-register-in/products/product.model.d.ts.map +1 -0
- package/dist/tests/tests/code-first-register-in/products/product.model.js +20 -0
- package/dist/tests/tests/code-first-register-in/products/products.module.d.ts +3 -0
- package/dist/tests/tests/code-first-register-in/products/products.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-register-in/products/products.module.js +14 -0
- package/dist/tests/tests/code-first-register-in/products/products.resolver.d.ts +5 -0
- package/dist/tests/tests/code-first-register-in/products/products.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-register-in/products/products.resolver.js +21 -0
- package/dist/tests/tests/code-first-register-in/shared/app-info.model.d.ts +4 -0
- package/dist/tests/tests/code-first-register-in/shared/app-info.model.d.ts.map +1 -0
- package/dist/tests/tests/code-first-register-in/shared/app-info.model.js +15 -0
- package/dist/tests/tests/code-first-register-in/users/create-user.input.d.ts +4 -0
- package/dist/tests/tests/code-first-register-in/users/create-user.input.d.ts.map +1 -0
- package/dist/tests/tests/code-first-register-in/users/create-user.input.js +16 -0
- package/dist/tests/tests/code-first-register-in/users/user.model.d.ts +7 -0
- package/dist/tests/tests/code-first-register-in/users/user.model.d.ts.map +1 -0
- package/dist/tests/tests/code-first-register-in/users/user.model.js +25 -0
- package/dist/tests/tests/code-first-register-in/users/users.module.d.ts +3 -0
- package/dist/tests/tests/code-first-register-in/users/users.module.d.ts.map +1 -0
- package/dist/tests/tests/code-first-register-in/users/users.module.js +14 -0
- package/dist/tests/tests/code-first-register-in/users/users.resolver.d.ts +8 -0
- package/dist/tests/tests/code-first-register-in/users/users.resolver.d.ts.map +1 -0
- package/dist/tests/tests/code-first-register-in/users/users.resolver.js +43 -0
- package/dist/tests/tests/duplicate-resolvers/app.module.d.ts +3 -0
- package/dist/tests/tests/duplicate-resolvers/app.module.d.ts.map +1 -0
- package/dist/tests/tests/duplicate-resolvers/app.module.js +27 -0
- package/dist/tests/tests/duplicate-resolvers/module-a/module-a.module.d.ts +3 -0
- package/dist/tests/tests/duplicate-resolvers/module-a/module-a.module.d.ts.map +1 -0
- package/dist/tests/tests/duplicate-resolvers/module-a/module-a.module.js +16 -0
- package/dist/tests/tests/duplicate-resolvers/module-a/user.resolver.d.ts +4 -0
- package/dist/tests/tests/duplicate-resolvers/module-a/user.resolver.d.ts.map +1 -0
- package/dist/tests/tests/duplicate-resolvers/module-a/user.resolver.js +21 -0
- package/dist/tests/tests/duplicate-resolvers/module-b/module-b.module.d.ts +3 -0
- package/dist/tests/tests/duplicate-resolvers/module-b/module-b.module.d.ts.map +1 -0
- package/dist/tests/tests/duplicate-resolvers/module-b/module-b.module.js +16 -0
- package/dist/tests/tests/duplicate-resolvers/module-b/user.resolver.d.ts +4 -0
- package/dist/tests/tests/duplicate-resolvers/module-b/user.resolver.d.ts.map +1 -0
- package/dist/tests/tests/duplicate-resolvers/module-b/user.resolver.js +21 -0
- package/dist/tests/tests/e2e/code-first-federation-caching.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/code-first-federation-caching.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/code-first-federation-caching.spec.js +96 -0
- package/dist/tests/tests/e2e/code-first-federation.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/code-first-federation.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/code-first-federation.spec.js +116 -0
- package/dist/tests/tests/e2e/code-first-inheritance.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/code-first-inheritance.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/code-first-inheritance.spec.js +93 -0
- package/dist/tests/tests/e2e/code-first-register-in.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/code-first-register-in.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/code-first-register-in.spec.js +203 -0
- package/dist/tests/tests/e2e/code-first-schema.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/code-first-schema.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/code-first-schema.spec.js +783 -0
- package/dist/tests/tests/e2e/code-first.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/code-first.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/code-first.spec.js +157 -0
- package/dist/tests/tests/e2e/custom-context.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/custom-context.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/custom-context.spec.js +48 -0
- package/dist/tests/tests/e2e/duplicate-resolvers.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/duplicate-resolvers.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/duplicate-resolvers.spec.js +65 -0
- package/dist/tests/tests/e2e/enum-union-directives.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/enum-union-directives.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/enum-union-directives.spec.js +122 -0
- package/dist/tests/tests/e2e/federation-timestamp-scalar.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/federation-timestamp-scalar.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/federation-timestamp-scalar.spec.js +88 -0
- package/dist/tests/tests/e2e/generated-definitions.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/generated-definitions.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/generated-definitions.spec.js +211 -0
- package/dist/tests/tests/e2e/global-prefix-fastify.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/global-prefix-fastify.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/global-prefix-fastify.spec.js +131 -0
- package/dist/tests/tests/e2e/global-prefix.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/global-prefix.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/global-prefix.spec.js +219 -0
- package/dist/tests/tests/e2e/graphiql-playground.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphiql-playground.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphiql-playground.spec.js +186 -0
- package/dist/tests/tests/e2e/graphql-async-class.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-async-class.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-async-class.spec.js +36 -0
- package/dist/tests/tests/e2e/graphql-async-existing.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-async-existing.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-async-existing.spec.js +36 -0
- package/dist/tests/tests/e2e/graphql-async.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-async.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-async.spec.js +34 -0
- package/dist/tests/tests/e2e/graphql-fastify.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-fastify.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-fastify.spec.js +48 -0
- package/dist/tests/tests/e2e/graphql-federation-async-class.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-federation-async-class.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-federation-async-class.spec.js +42 -0
- package/dist/tests/tests/e2e/graphql-federation-async-existing.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-federation-async-existing.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-federation-async-existing.spec.js +42 -0
- package/dist/tests/tests/e2e/graphql-federation-async.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-federation-async.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-federation-async.spec.js +42 -0
- package/dist/tests/tests/e2e/graphql-federation-fastify.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-federation-fastify.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-federation-fastify.spec.js +48 -0
- package/dist/tests/tests/e2e/graphql-federation-schema-host.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-federation-schema-host.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-federation-schema-host.spec.js +23 -0
- package/dist/tests/tests/e2e/graphql-federation.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-federation.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-federation.spec.js +202 -0
- package/dist/tests/tests/e2e/graphql-gateway-async-class.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-gateway-async-class.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-gateway-async-class.spec.js +103 -0
- package/dist/tests/tests/e2e/graphql-gateway-async-existing.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-gateway-async-existing.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-gateway-async-existing.spec.js +103 -0
- package/dist/tests/tests/e2e/graphql-gateway-async.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-gateway-async.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-gateway-async.spec.js +83 -0
- package/dist/tests/tests/e2e/graphql-gateway-fastify.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-gateway-fastify.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-gateway-fastify.spec.js +119 -0
- package/dist/tests/tests/e2e/graphql-gateway-transform-schema.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-gateway-transform-schema.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-gateway-transform-schema.spec.js +108 -0
- package/dist/tests/tests/e2e/graphql-gateway.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-gateway.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-gateway.spec.js +121 -0
- package/dist/tests/tests/e2e/graphql-request-scoped.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-request-scoped.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-request-scoped.spec.js +56 -0
- package/dist/tests/tests/e2e/graphql-sort-auto-schema.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-sort-auto-schema.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-sort-auto-schema.spec.js +38 -0
- package/dist/tests/tests/e2e/graphql-sort-schema.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-sort-schema.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-sort-schema.spec.js +50 -0
- package/dist/tests/tests/e2e/graphql-transform-auto-schema-file.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql-transform-auto-schema-file.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql-transform-auto-schema-file.spec.js +29 -0
- package/dist/tests/tests/e2e/graphql.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/graphql.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/graphql.spec.js +52 -0
- package/dist/tests/tests/e2e/guards-filters.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/guards-filters.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/guards-filters.spec.js +45 -0
- package/dist/tests/tests/e2e/issue-2940-http-error-status.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/issue-2940-http-error-status.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/issue-2940-http-error-status.spec.js +127 -0
- package/dist/tests/tests/e2e/pipes.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/pipes.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/pipes.spec.js +50 -0
- package/dist/tests/tests/e2e/request-scoped.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/request-scoped.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/request-scoped.spec.js +86 -0
- package/dist/tests/tests/e2e/resolver-registration-methods.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/resolver-registration-methods.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/resolver-registration-methods.spec.js +88 -0
- package/dist/tests/tests/e2e/serialized-graph.spec.d.ts +2 -0
- package/dist/tests/tests/e2e/serialized-graph.spec.d.ts.map +1 -0
- package/dist/tests/tests/e2e/serialized-graph.spec.js +23 -0
- package/dist/tests/tests/generated-definitions/array-property.fixture.d.ts +12 -0
- package/dist/tests/tests/generated-definitions/array-property.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/array-property.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/array-property.test-definitions.d.ts +12 -0
- package/dist/tests/tests/generated-definitions/array-property.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/array-property.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/custom-header.fixture.d.ts +2 -0
- package/dist/tests/tests/generated-definitions/custom-header.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/custom-header.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/custom-header.test-definitions.d.ts +2 -0
- package/dist/tests/tests/generated-definitions/custom-header.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/custom-header.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-default-type.fixture.d.ts +2 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-default-type.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-default-type.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-default-type.test-definitions.d.ts +2 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-default-type.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-default-type.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-type-mapping.fixture.d.ts +4 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-type-mapping.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-type-mapping.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-type-mapping.test-definitions.d.ts +4 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-type-mapping.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/custom-scalar-type-mapping.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/custom-scalar.fixture.d.ts +2 -0
- package/dist/tests/tests/generated-definitions/custom-scalar.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/custom-scalar.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/custom-scalar.test-definitions.d.ts +2 -0
- package/dist/tests/tests/generated-definitions/custom-scalar.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/custom-scalar.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/enum-as-type.fixture.d.ts +2 -0
- package/dist/tests/tests/generated-definitions/enum-as-type.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/enum-as-type.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/enum-as-type.test-definitions.d.ts +2 -0
- package/dist/tests/tests/generated-definitions/enum-as-type.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/enum-as-type.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/enum.fixture.d.ts +6 -0
- package/dist/tests/tests/generated-definitions/enum.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/enum.fixture.js +16 -0
- package/dist/tests/tests/generated-definitions/enum.test-definitions.d.ts +6 -0
- package/dist/tests/tests/generated-definitions/enum.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/enum.test-definitions.js +16 -0
- package/dist/tests/tests/generated-definitions/federation-partial-query.fixture.d.ts +6 -0
- package/dist/tests/tests/generated-definitions/federation-partial-query.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/federation-partial-query.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/federation-partial-query.test-definitions.d.ts +6 -0
- package/dist/tests/tests/generated-definitions/federation-partial-query.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/federation-partial-query.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/federation-typedef.fixture.d.ts +23 -0
- package/dist/tests/tests/generated-definitions/federation-typedef.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/federation-typedef.fixture.js +28 -0
- package/dist/tests/tests/generated-definitions/federation-typedef.test-definitions.d.ts +23 -0
- package/dist/tests/tests/generated-definitions/federation-typedef.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/federation-typedef.test-definitions.js +28 -0
- package/dist/tests/tests/generated-definitions/federation.fixture.d.ts +19 -0
- package/dist/tests/tests/generated-definitions/federation.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/federation.fixture.js +23 -0
- package/dist/tests/tests/generated-definitions/federation.test-definitions.d.ts +19 -0
- package/dist/tests/tests/generated-definitions/federation.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/federation.test-definitions.js +23 -0
- package/dist/tests/tests/generated-definitions/interface-property.fixture.d.ts +10 -0
- package/dist/tests/tests/generated-definitions/interface-property.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/interface-property.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/interface-property.test-definitions.d.ts +10 -0
- package/dist/tests/tests/generated-definitions/interface-property.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/interface-property.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/mutation.fixture.d.ts +13 -0
- package/dist/tests/tests/generated-definitions/mutation.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/mutation.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/mutation.test-definitions.d.ts +13 -0
- package/dist/tests/tests/generated-definitions/mutation.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/mutation.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/query-skip-args.fixture.d.ts +9 -0
- package/dist/tests/tests/generated-definitions/query-skip-args.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/query-skip-args.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/query-skip-args.test-definitions.d.ts +9 -0
- package/dist/tests/tests/generated-definitions/query-skip-args.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/query-skip-args.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/query.fixture.d.ts +9 -0
- package/dist/tests/tests/generated-definitions/query.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/query.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/query.test-definitions.d.ts +9 -0
- package/dist/tests/tests/generated-definitions/query.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/query.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/simple-type.fixture.d.ts +10 -0
- package/dist/tests/tests/generated-definitions/simple-type.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/simple-type.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/simple-type.test-definitions.d.ts +10 -0
- package/dist/tests/tests/generated-definitions/simple-type.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/simple-type.test-definitions.js +7 -0
- package/dist/tests/tests/generated-definitions/type-name.fixture.d.ts +33 -0
- package/dist/tests/tests/generated-definitions/type-name.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/type-name.fixture.js +16 -0
- package/dist/tests/tests/generated-definitions/type-name.test-definitions.d.ts +33 -0
- package/dist/tests/tests/generated-definitions/type-name.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/type-name.test-definitions.js +16 -0
- package/dist/tests/tests/generated-definitions/typename.fixture.d.ts +11 -0
- package/dist/tests/tests/generated-definitions/typename.fixture.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/typename.fixture.js +7 -0
- package/dist/tests/tests/generated-definitions/typename.test-definitions.d.ts +11 -0
- package/dist/tests/tests/generated-definitions/typename.test-definitions.d.ts.map +1 -0
- package/dist/tests/tests/generated-definitions/typename.test-definitions.js +7 -0
- package/dist/tests/tests/graphql/app.module.d.ts +3 -0
- package/dist/tests/tests/graphql/app.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/app.module.js +23 -0
- package/dist/tests/tests/graphql/async-options-class.module.d.ts +3 -0
- package/dist/tests/tests/graphql/async-options-class.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/async-options-class.module.js +30 -0
- package/dist/tests/tests/graphql/async-options-existing.module.d.ts +3 -0
- package/dist/tests/tests/graphql/async-options-existing.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/async-options-existing.module.js +25 -0
- package/dist/tests/tests/graphql/async-options.module.d.ts +3 -0
- package/dist/tests/tests/graphql/async-options.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/async-options.module.js +25 -0
- package/dist/tests/tests/graphql/cats/cats-request-scoped.service.d.ts +10 -0
- package/dist/tests/tests/graphql/cats/cats-request-scoped.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql/cats/cats-request-scoped.service.js +28 -0
- package/dist/tests/tests/graphql/cats/cats.guard.d.ts +5 -0
- package/dist/tests/tests/graphql/cats/cats.guard.d.ts.map +1 -0
- package/dist/tests/tests/graphql/cats/cats.guard.js +16 -0
- package/dist/tests/tests/graphql/cats/cats.module.d.ts +5 -0
- package/dist/tests/tests/graphql/cats/cats.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/cats/cats.module.js +29 -0
- package/dist/tests/tests/graphql/cats/cats.resolvers.d.ts +13 -0
- package/dist/tests/tests/graphql/cats/cats.resolvers.d.ts.map +1 -0
- package/dist/tests/tests/graphql/cats/cats.resolvers.js +79 -0
- package/dist/tests/tests/graphql/cats/cats.service.d.ts +10 -0
- package/dist/tests/tests/graphql/cats/cats.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql/cats/cats.service.js +28 -0
- package/dist/tests/tests/graphql/cats/interfaces/cat.interface.d.ts +6 -0
- package/dist/tests/tests/graphql/cats/interfaces/cat.interface.d.ts.map +1 -0
- package/dist/tests/tests/graphql/cats/interfaces/cat.interface.js +2 -0
- package/dist/tests/tests/graphql/common/scalars/date.scalar.d.ts +7 -0
- package/dist/tests/tests/graphql/common/scalars/date.scalar.d.ts.map +1 -0
- package/dist/tests/tests/graphql/common/scalars/date.scalar.js +27 -0
- package/dist/tests/tests/graphql/config.module.d.ts +3 -0
- package/dist/tests/tests/graphql/config.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/config.module.js +15 -0
- package/dist/tests/tests/graphql/config.service.d.ts +5 -0
- package/dist/tests/tests/graphql/config.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql/config.service.js +17 -0
- package/dist/tests/tests/graphql/custom-context/custom-context.module.d.ts +3 -0
- package/dist/tests/tests/graphql/custom-context/custom-context.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/custom-context/custom-context.module.js +26 -0
- package/dist/tests/tests/graphql/custom-context/custom-context.resolver.d.ts +4 -0
- package/dist/tests/tests/graphql/custom-context/custom-context.resolver.d.ts.map +1 -0
- package/dist/tests/tests/graphql/custom-context/custom-context.resolver.js +21 -0
- package/dist/tests/tests/graphql/global-prefix-async-options-class.module.d.ts +3 -0
- package/dist/tests/tests/graphql/global-prefix-async-options-class.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/global-prefix-async-options-class.module.js +31 -0
- package/dist/tests/tests/graphql/global-prefix-async-options.module.d.ts +3 -0
- package/dist/tests/tests/graphql/global-prefix-async-options.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/global-prefix-async-options.module.js +26 -0
- package/dist/tests/tests/graphql/global-prefix.module.d.ts +3 -0
- package/dist/tests/tests/graphql/global-prefix.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/global-prefix.module.js +24 -0
- package/dist/tests/tests/graphql/graphiql-playground.module.d.ts +12 -0
- package/dist/tests/tests/graphql/graphiql-playground.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/graphiql-playground.module.js +44 -0
- package/dist/tests/tests/graphql/hello/dto/test.dto.d.ts +5 -0
- package/dist/tests/tests/graphql/hello/dto/test.dto.d.ts.map +1 -0
- package/dist/tests/tests/graphql/hello/dto/test.dto.js +17 -0
- package/dist/tests/tests/graphql/hello/guards/request-scoped.guard.d.ts +10 -0
- package/dist/tests/tests/graphql/hello/guards/request-scoped.guard.d.ts.map +1 -0
- package/dist/tests/tests/graphql/hello/guards/request-scoped.guard.js +24 -0
- package/dist/tests/tests/graphql/hello/hello.module.d.ts +7 -0
- package/dist/tests/tests/graphql/hello/hello.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/hello/hello.module.js +46 -0
- package/dist/tests/tests/graphql/hello/hello.resolver.d.ts +10 -0
- package/dist/tests/tests/graphql/hello/hello.resolver.d.ts.map +1 -0
- package/dist/tests/tests/graphql/hello/hello.resolver.js +36 -0
- package/dist/tests/tests/graphql/hello/hello.service.d.ts +6 -0
- package/dist/tests/tests/graphql/hello/hello.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql/hello/hello.service.js +19 -0
- package/dist/tests/tests/graphql/hello/interceptors/logging.interceptor.d.ts +10 -0
- package/dist/tests/tests/graphql/hello/interceptors/logging.interceptor.d.ts.map +1 -0
- package/dist/tests/tests/graphql/hello/interceptors/logging.interceptor.js +24 -0
- package/dist/tests/tests/graphql/hello/users/user-by-id.pipe.d.ts +13 -0
- package/dist/tests/tests/graphql/hello/users/user-by-id.pipe.d.ts.map +1 -0
- package/dist/tests/tests/graphql/hello/users/user-by-id.pipe.js +26 -0
- package/dist/tests/tests/graphql/hello/users/users.service.d.ts +11 -0
- package/dist/tests/tests/graphql/hello/users/users.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql/hello/users/users.service.js +27 -0
- package/dist/tests/tests/graphql/main.d.ts +2 -0
- package/dist/tests/tests/graphql/main.d.ts.map +1 -0
- package/dist/tests/tests/graphql/main.js +9 -0
- package/dist/tests/tests/graphql/sort-auto-schema.module.d.ts +3 -0
- package/dist/tests/tests/graphql/sort-auto-schema.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/sort-auto-schema.module.js +28 -0
- package/dist/tests/tests/graphql/sort-schema.module.d.ts +3 -0
- package/dist/tests/tests/graphql/sort-schema.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/sort-schema.module.js +24 -0
- package/dist/tests/tests/graphql/transform-auto-schema-file.module.d.ts +3 -0
- package/dist/tests/tests/graphql/transform-auto-schema-file.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql/transform-auto-schema-file.module.js +27 -0
- package/dist/tests/tests/graphql-federation/gateway/config/config.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/gateway/config/config.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/gateway/config/config.module.js +15 -0
- package/dist/tests/tests/graphql-federation/gateway/config/config.service.d.ts +5 -0
- package/dist/tests/tests/graphql-federation/gateway/config/config.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/gateway/config/config.service.js +19 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async-class.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async-class.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async-class.module.js +24 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async-existing.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async-existing.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async-existing.module.js +24 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway-async.module.js +26 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/gateway/gateway.module.js +24 -0
- package/dist/tests/tests/graphql-federation/gateway/supergraph-sdl.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/gateway/supergraph-sdl.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/gateway/supergraph-sdl.js +95 -0
- package/dist/tests/tests/graphql-federation/posts-service/federation-posts.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/posts-service/federation-posts.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/federation-posts.module.js +27 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/date.scalar.d.ts +9 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/date.scalar.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/date.scalar.js +31 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/post-type.enum.d.ts +5 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/post-type.enum.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/post-type.enum.js +8 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.interfaces.d.ts +10 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.interfaces.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.interfaces.js +2 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.module.js +17 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.resolvers.d.ts +14 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.resolvers.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.resolvers.js +53 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.service.d.ts +11 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/posts.service.js +41 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/upper.directive.d.ts +2 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/upper.directive.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/upper.directive.js +25 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/users.resolvers.d.ts +7 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/users.resolvers.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/posts-service/posts/users.resolvers.js +25 -0
- package/dist/tests/tests/graphql-federation/users-service/config/config.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/users-service/config/config.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/config/config.module.js +15 -0
- package/dist/tests/tests/graphql-federation/users-service/config/config.service.d.ts +5 -0
- package/dist/tests/tests/graphql-federation/users-service/config/config.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/config/config.service.js +19 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async-class.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async-class.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async-class.module.js +26 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async-existing.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async-existing.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async-existing.module.js +26 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.async.module.js +28 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/federation-users.module.js +25 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.interfaces.d.ts +5 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.interfaces.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.interfaces.js +2 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.module.d.ts +3 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.module.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.module.js +15 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.resolvers.d.ts +11 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.resolvers.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.resolvers.js +35 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.service.d.ts +6 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.service.d.ts.map +1 -0
- package/dist/tests/tests/graphql-federation/users-service/users/users.service.js +22 -0
- package/dist/tests/tests/subscriptions/app/app.module.d.ts +11 -0
- package/dist/tests/tests/subscriptions/app/app.module.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/app/app.module.js +30 -0
- package/dist/tests/tests/subscriptions/app/auth.guard.d.ts +5 -0
- package/dist/tests/tests/subscriptions/app/auth.guard.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/app/auth.guard.js +16 -0
- package/dist/tests/tests/subscriptions/app/notification.d.ts +6 -0
- package/dist/tests/tests/subscriptions/app/notification.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/app/notification.js +29 -0
- package/dist/tests/tests/subscriptions/app/notification.module.d.ts +3 -0
- package/dist/tests/tests/subscriptions/app/notification.module.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/app/notification.module.js +14 -0
- package/dist/tests/tests/subscriptions/app/notification.resolver.d.ts +10 -0
- package/dist/tests/tests/subscriptions/app/notification.resolver.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/app/notification.resolver.js +50 -0
- package/dist/tests/tests/subscriptions/async-iterator.spec.d.ts +2 -0
- package/dist/tests/tests/subscriptions/async-iterator.spec.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/async-iterator.spec.js +48 -0
- package/dist/tests/tests/subscriptions/federation-app/federation-app.module.d.ts +9 -0
- package/dist/tests/tests/subscriptions/federation-app/federation-app.module.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/federation-app/federation-app.module.js +29 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.d.ts +6 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.js +23 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.module.d.ts +3 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.module.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.module.js +14 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.resolver.d.ts +8 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.resolver.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/federation-app/notification.resolver.js +39 -0
- package/dist/tests/tests/subscriptions/federation-graphql-ws.spec.d.ts +2 -0
- package/dist/tests/tests/subscriptions/federation-graphql-ws.spec.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/federation-graphql-ws.spec.js +114 -0
- package/dist/tests/tests/subscriptions/graphql-ws.spec.d.ts +2 -0
- package/dist/tests/tests/subscriptions/graphql-ws.spec.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/graphql-ws.spec.js +238 -0
- package/dist/tests/tests/subscriptions/utils/graphql-ws.link.d.ts +9 -0
- package/dist/tests/tests/subscriptions/utils/graphql-ws.link.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/utils/graphql-ws.link.js +22 -0
- package/dist/tests/tests/subscriptions/utils/malformed-token.exception.d.ts +4 -0
- package/dist/tests/tests/subscriptions/utils/malformed-token.exception.d.ts.map +1 -0
- package/dist/tests/tests/subscriptions/utils/malformed-token.exception.js +9 -0
- package/dist/tests/tests/utils/assertion-utils.d.ts +4 -0
- package/dist/tests/tests/utils/assertion-utils.d.ts.map +1 -0
- package/dist/tests/tests/utils/assertion-utils.js +11 -0
- package/dist/tests/tests/utils/introspection-schema.utils.d.ts +8 -0
- package/dist/tests/tests/utils/introspection-schema.utils.d.ts.map +1 -0
- package/dist/tests/tests/utils/introspection-schema.utils.js +29 -0
- package/dist/tests/tests/utils/printed-schema-with-cache-control.snapshot.d.ts +2 -0
- package/dist/tests/tests/utils/printed-schema-with-cache-control.snapshot.d.ts.map +1 -0
- package/dist/tests/tests/utils/printed-schema-with-cache-control.snapshot.js +47 -0
- package/dist/tests/tests/utils/printed-schema.snapshot.d.ts +3 -0
- package/dist/tests/tests/utils/printed-schema.snapshot.d.ts.map +1 -0
- package/dist/tests/tests/utils/printed-schema.snapshot.js +217 -0
- package/dist/tests/tsconfig.spec.tsbuildinfo +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var NotificationResolver_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NotificationResolver = exports.pubSub = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
8
|
+
const graphql_subscriptions_1 = require("graphql-subscriptions");
|
|
9
|
+
const auth_guard_1 = require("./auth.guard");
|
|
10
|
+
const notification_1 = require("./notification");
|
|
11
|
+
exports.pubSub = new graphql_subscriptions_1.PubSub();
|
|
12
|
+
let NotificationResolver = NotificationResolver_1 = class NotificationResolver {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.logger = new common_1.Logger(NotificationResolver_1.name);
|
|
15
|
+
}
|
|
16
|
+
getNotification() {
|
|
17
|
+
return {
|
|
18
|
+
message: 'Hello!',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
newNotification(id) {
|
|
22
|
+
this.logger.log('User subscribed to newNotification');
|
|
23
|
+
return exports.pubSub.asyncIterableIterator('newNotification');
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.NotificationResolver = NotificationResolver;
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, graphql_1.Query)(() => notification_1.Notification),
|
|
29
|
+
tslib_1.__metadata("design:type", Function),
|
|
30
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
31
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
32
|
+
], NotificationResolver.prototype, "getNotification", null);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, common_1.UseGuards)(auth_guard_1.AuthGuard),
|
|
35
|
+
(0, graphql_1.Subscription)(() => notification_1.Notification, {
|
|
36
|
+
filter(payload, variables, context) {
|
|
37
|
+
return (context.user === payload.newNotification.recipient &&
|
|
38
|
+
payload.newNotification.id === variables.id);
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
tslib_1.__param(0, (0, graphql_1.Args)('id', {
|
|
42
|
+
nullable: false,
|
|
43
|
+
})),
|
|
44
|
+
tslib_1.__metadata("design:type", Function),
|
|
45
|
+
tslib_1.__metadata("design:paramtypes", [String]),
|
|
46
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
47
|
+
], NotificationResolver.prototype, "newNotification", null);
|
|
48
|
+
exports.NotificationResolver = NotificationResolver = NotificationResolver_1 = tslib_1.__decorate([
|
|
49
|
+
(0, graphql_1.Resolver)(() => notification_1.Notification)
|
|
50
|
+
], NotificationResolver);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-iterator.spec.d.ts","sourceRoot":"","sources":["../../../../tests/subscriptions/async-iterator.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Old implementation of with-filter was leaking memory with was visible
|
|
3
|
+
// in case with long lived subscriptions where filter is skipping most of messages
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
const iterall_1 = require("iterall");
|
|
6
|
+
const v8_1 = require("v8");
|
|
7
|
+
const vm_1 = require("vm");
|
|
8
|
+
const async_iterator_util_1 = require("../../lib/utils/async-iterator.util");
|
|
9
|
+
(0, v8_1.setFlagsFromString)('--expose_gc');
|
|
10
|
+
const gc = (0, vm_1.runInNewContext)('gc');
|
|
11
|
+
// https://github.com/apollographql/graphql-subscriptions/issues/212
|
|
12
|
+
it('does not leak memory with promise chain #memory', async function () {
|
|
13
|
+
vi.setConfig({ testTimeout: 5000 });
|
|
14
|
+
let stopped = false;
|
|
15
|
+
let index = 0;
|
|
16
|
+
const asyncIterator = {
|
|
17
|
+
async next() {
|
|
18
|
+
if (stopped) {
|
|
19
|
+
return Promise.resolve({ done: true, value: undefined });
|
|
20
|
+
}
|
|
21
|
+
index += 1;
|
|
22
|
+
return new Promise((resolve) => setImmediate(resolve)).then(() => ({
|
|
23
|
+
done: false,
|
|
24
|
+
value: index,
|
|
25
|
+
}));
|
|
26
|
+
},
|
|
27
|
+
return() {
|
|
28
|
+
return Promise.resolve({ value: undefined, done: true });
|
|
29
|
+
},
|
|
30
|
+
throw(error) {
|
|
31
|
+
return Promise.reject(error);
|
|
32
|
+
},
|
|
33
|
+
[iterall_1.$$asyncIterator]() {
|
|
34
|
+
return this;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const filteredAsyncIterator = await (0, async_iterator_util_1.createAsyncIterator)(Promise.resolve(asyncIterator), () => stopped);
|
|
38
|
+
gc();
|
|
39
|
+
const heapUsed = process.memoryUsage().heapUsed;
|
|
40
|
+
const nextPromise = filteredAsyncIterator.next();
|
|
41
|
+
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
42
|
+
gc();
|
|
43
|
+
const heapUsed2 = process.memoryUsage().heapUsed;
|
|
44
|
+
stopped = true;
|
|
45
|
+
await nextPromise;
|
|
46
|
+
// Heap memory goes up for less than 1%
|
|
47
|
+
expect(Math.max(0, heapUsed2 - heapUsed) / heapUsed).toBeLessThan(0.01);
|
|
48
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { ApolloDriverConfig } from '../../../lib';
|
|
3
|
+
export type FederationAppModuleConfig = {
|
|
4
|
+
subscriptions?: ApolloDriverConfig['subscriptions'];
|
|
5
|
+
};
|
|
6
|
+
export declare class FederationAppModule {
|
|
7
|
+
static forRoot(options?: FederationAppModuleConfig): DynamicModule;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=federation-app.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federation-app.module.d.ts","sourceRoot":"","sources":["../../../../../tests/subscriptions/federation-app/federation-app.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAIlD,MAAM,MAAM,yBAAyB,GAAG;IACtC,aAAa,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;CACrD,CAAC;AAEF,qBACa,mBAAmB;IAC9B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,aAAa;CAcnE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var FederationAppModule_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.FederationAppModule = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
8
|
+
const drivers_1 = require("../../../lib/drivers");
|
|
9
|
+
const notification_module_1 = require("./notification.module");
|
|
10
|
+
let FederationAppModule = FederationAppModule_1 = class FederationAppModule {
|
|
11
|
+
static forRoot(options) {
|
|
12
|
+
return {
|
|
13
|
+
module: FederationAppModule_1,
|
|
14
|
+
imports: [
|
|
15
|
+
notification_module_1.NotificationModule,
|
|
16
|
+
graphql_1.GraphQLModule.forRoot({
|
|
17
|
+
driver: drivers_1.ApolloFederationDriver,
|
|
18
|
+
autoSchemaFile: true,
|
|
19
|
+
includeStacktraceInErrorResponses: false,
|
|
20
|
+
subscriptions: options?.subscriptions,
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.FederationAppModule = FederationAppModule;
|
|
27
|
+
exports.FederationAppModule = FederationAppModule = FederationAppModule_1 = tslib_1.__decorate([
|
|
28
|
+
(0, common_1.Module)({})
|
|
29
|
+
], FederationAppModule);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../../../tests/subscriptions/federation-app/notification.ts"],"names":[],"mappings":"AAEA,qBACa,YAAY;IAEvB,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Notification = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
6
|
+
let Notification = class Notification {
|
|
7
|
+
};
|
|
8
|
+
exports.Notification = Notification;
|
|
9
|
+
tslib_1.__decorate([
|
|
10
|
+
(0, graphql_1.Field)({ nullable: false }),
|
|
11
|
+
tslib_1.__metadata("design:type", String)
|
|
12
|
+
], Notification.prototype, "id", void 0);
|
|
13
|
+
tslib_1.__decorate([
|
|
14
|
+
(0, graphql_1.Field)({ nullable: false }),
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
16
|
+
], Notification.prototype, "recipient", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, graphql_1.Field)({ nullable: false }),
|
|
19
|
+
tslib_1.__metadata("design:type", String)
|
|
20
|
+
], Notification.prototype, "message", void 0);
|
|
21
|
+
exports.Notification = Notification = tslib_1.__decorate([
|
|
22
|
+
(0, graphql_1.ObjectType)()
|
|
23
|
+
], Notification);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.module.d.ts","sourceRoot":"","sources":["../../../../../tests/subscriptions/federation-app/notification.module.ts"],"names":[],"mappings":"AAGA,qBAGa,kBAAkB;CAAG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const notification_resolver_1 = require("./notification.resolver");
|
|
7
|
+
let NotificationModule = class NotificationModule {
|
|
8
|
+
};
|
|
9
|
+
exports.NotificationModule = NotificationModule;
|
|
10
|
+
exports.NotificationModule = NotificationModule = tslib_1.__decorate([
|
|
11
|
+
(0, common_1.Module)({
|
|
12
|
+
providers: [notification_resolver_1.NotificationResolver],
|
|
13
|
+
})
|
|
14
|
+
], NotificationModule);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PubSub } from 'graphql-subscriptions';
|
|
2
|
+
import { Notification } from './notification';
|
|
3
|
+
export declare const pubSub: PubSub<Record<string, never>>;
|
|
4
|
+
export declare class NotificationResolver {
|
|
5
|
+
getFederatedNotification(): Notification;
|
|
6
|
+
newFederatedNotification(id: string, recipient: string): import("graphql-subscriptions/dist/pubsub-async-iterable-iterator").PubSubAsyncIterableIterator<unknown>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=notification.resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.resolver.d.ts","sourceRoot":"","sources":["../../../../../tests/subscriptions/federation-app/notification.resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,MAAM,+BAAe,CAAC;AAEnC,qBACa,oBAAoB;IAE/B,wBAAwB,IAAI,YAAY;IAYxC,wBAAwB,CACW,EAAE,EAAE,MAAM,EACH,SAAS,EAAE,MAAM;CAI5D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationResolver = exports.pubSub = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
6
|
+
const graphql_subscriptions_1 = require("graphql-subscriptions");
|
|
7
|
+
const notification_1 = require("./notification");
|
|
8
|
+
exports.pubSub = new graphql_subscriptions_1.PubSub();
|
|
9
|
+
let NotificationResolver = class NotificationResolver {
|
|
10
|
+
getFederatedNotification() {
|
|
11
|
+
return { id: '0', recipient: 'system', message: 'ok' };
|
|
12
|
+
}
|
|
13
|
+
newFederatedNotification(id, recipient) {
|
|
14
|
+
return exports.pubSub.asyncIterableIterator('newFederatedNotification');
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.NotificationResolver = NotificationResolver;
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, graphql_1.Query)(() => notification_1.Notification),
|
|
20
|
+
tslib_1.__metadata("design:type", Function),
|
|
21
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
22
|
+
tslib_1.__metadata("design:returntype", notification_1.Notification)
|
|
23
|
+
], NotificationResolver.prototype, "getFederatedNotification", null);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, graphql_1.Subscription)(() => notification_1.Notification, {
|
|
26
|
+
filter(payload, variables) {
|
|
27
|
+
return (payload.newFederatedNotification.id === variables.id &&
|
|
28
|
+
payload.newFederatedNotification.recipient === variables.recipient);
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
tslib_1.__param(0, (0, graphql_1.Args)('id', { nullable: false })),
|
|
32
|
+
tslib_1.__param(1, (0, graphql_1.Args)('recipient', { nullable: false })),
|
|
33
|
+
tslib_1.__metadata("design:type", Function),
|
|
34
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
35
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
36
|
+
], NotificationResolver.prototype, "newFederatedNotification", null);
|
|
37
|
+
exports.NotificationResolver = NotificationResolver = tslib_1.__decorate([
|
|
38
|
+
(0, graphql_1.Resolver)(() => notification_1.Notification)
|
|
39
|
+
], NotificationResolver);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federation-graphql-ws.spec.d.ts","sourceRoot":"","sources":["../../../../tests/subscriptions/federation-graphql-ws.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const testing_1 = require("@nestjs/testing");
|
|
5
|
+
const apollo_cache_inmemory_1 = require("apollo-cache-inmemory");
|
|
6
|
+
const apollo_client_1 = tslib_1.__importDefault(require("apollo-client"));
|
|
7
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
8
|
+
const graphql_ws_1 = require("graphql-ws");
|
|
9
|
+
const supertest_1 = tslib_1.__importDefault(require("supertest"));
|
|
10
|
+
const ws_1 = tslib_1.__importDefault(require("ws"));
|
|
11
|
+
const federation_app_module_1 = require("./federation-app/federation-app.module");
|
|
12
|
+
const notification_resolver_1 = require("./federation-app/notification.resolver");
|
|
13
|
+
const graphql_ws_link_1 = require("./utils/graphql-ws.link");
|
|
14
|
+
const subscriptionQuery = (0, graphql_tag_1.gql) `
|
|
15
|
+
subscription FederatedSubscription($id: String!, $recipient: String!) {
|
|
16
|
+
newFederatedNotification(id: $id, recipient: $recipient) {
|
|
17
|
+
id
|
|
18
|
+
recipient
|
|
19
|
+
message
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
describe('GraphQL Federation - graphql-ws subscriptions', () => {
|
|
24
|
+
let app;
|
|
25
|
+
let wsClient;
|
|
26
|
+
let port;
|
|
27
|
+
beforeEach(async () => {
|
|
28
|
+
const module = await testing_1.Test.createTestingModule({
|
|
29
|
+
imports: [
|
|
30
|
+
federation_app_module_1.FederationAppModule.forRoot({
|
|
31
|
+
subscriptions: { 'graphql-ws': {} },
|
|
32
|
+
}),
|
|
33
|
+
],
|
|
34
|
+
}).compile();
|
|
35
|
+
app = module.createNestApplication();
|
|
36
|
+
await app.init();
|
|
37
|
+
await app.listen(0);
|
|
38
|
+
port = app.getHttpServer().address().port;
|
|
39
|
+
});
|
|
40
|
+
afterEach(async () => {
|
|
41
|
+
try {
|
|
42
|
+
await wsClient?.dispose();
|
|
43
|
+
}
|
|
44
|
+
catch { }
|
|
45
|
+
await app.close();
|
|
46
|
+
});
|
|
47
|
+
it('should connect and receive a filtered notification', async () => {
|
|
48
|
+
wsClient = (0, graphql_ws_1.createClient)({
|
|
49
|
+
url: `ws://localhost:${port}/graphql`,
|
|
50
|
+
webSocketImpl: ws_1.default,
|
|
51
|
+
retryAttempts: 0,
|
|
52
|
+
});
|
|
53
|
+
wsClient.on('connected', () => {
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
notification_resolver_1.pubSub.publish('newFederatedNotification', {
|
|
56
|
+
newFederatedNotification: {
|
|
57
|
+
id: '99',
|
|
58
|
+
recipient: 'alice',
|
|
59
|
+
message: 'wrong id',
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
notification_resolver_1.pubSub.publish('newFederatedNotification', {
|
|
63
|
+
newFederatedNotification: {
|
|
64
|
+
id: '1',
|
|
65
|
+
recipient: 'bob',
|
|
66
|
+
message: 'wrong recipient',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
notification_resolver_1.pubSub.publish('newFederatedNotification', {
|
|
70
|
+
newFederatedNotification: {
|
|
71
|
+
id: '1',
|
|
72
|
+
recipient: 'alice',
|
|
73
|
+
message: 'Hello from federation',
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}, 100);
|
|
77
|
+
});
|
|
78
|
+
const apolloClient = new apollo_client_1.default({
|
|
79
|
+
link: new graphql_ws_link_1.GraphQLWsLink(wsClient),
|
|
80
|
+
cache: new apollo_cache_inmemory_1.InMemoryCache(),
|
|
81
|
+
});
|
|
82
|
+
await new Promise((resolve, reject) => {
|
|
83
|
+
apolloClient
|
|
84
|
+
.subscribe({
|
|
85
|
+
query: subscriptionQuery,
|
|
86
|
+
variables: { id: '1', recipient: 'alice' },
|
|
87
|
+
})
|
|
88
|
+
.subscribe({
|
|
89
|
+
next(value) {
|
|
90
|
+
try {
|
|
91
|
+
expect(value.data.newFederatedNotification.id).toEqual('1');
|
|
92
|
+
expect(value.data.newFederatedNotification.recipient).toEqual('alice');
|
|
93
|
+
expect(value.data.newFederatedNotification.message).toEqual('Hello from federation');
|
|
94
|
+
resolve();
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
reject(e);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
complete() { },
|
|
101
|
+
error: reject,
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
it('should expose the Subscription type in the federation SDL', async () => {
|
|
106
|
+
const response = await (0, supertest_1.default)(app.getHttpServer())
|
|
107
|
+
.post('/graphql')
|
|
108
|
+
.send({ query: '{ _service { sdl } }' })
|
|
109
|
+
.expect(200);
|
|
110
|
+
const sdl = response.body.data._service.sdl;
|
|
111
|
+
expect(sdl).toContain('type Subscription');
|
|
112
|
+
expect(sdl).toContain('newFederatedNotification');
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-ws.spec.d.ts","sourceRoot":"","sources":["../../../../tests/subscriptions/graphql-ws.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const testing_1 = require("@nestjs/testing");
|
|
5
|
+
const apollo_cache_inmemory_1 = require("apollo-cache-inmemory");
|
|
6
|
+
const apollo_client_1 = tslib_1.__importStar(require("apollo-client"));
|
|
7
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
8
|
+
const graphql_ws_1 = require("graphql-ws");
|
|
9
|
+
const ws_1 = tslib_1.__importDefault(require("ws"));
|
|
10
|
+
const app_module_1 = require("./app/app.module");
|
|
11
|
+
const notification_resolver_1 = require("./app/notification.resolver");
|
|
12
|
+
const graphql_ws_link_1 = require("./utils/graphql-ws.link");
|
|
13
|
+
const malformed_token_exception_1 = require("./utils/malformed-token.exception");
|
|
14
|
+
const subscriptionQuery = (0, graphql_tag_1.gql) `
|
|
15
|
+
subscription TestSubscription($id: String!) {
|
|
16
|
+
newNotification(id: $id) {
|
|
17
|
+
id
|
|
18
|
+
message
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
describe('graphql-ws protocol', () => {
|
|
23
|
+
let app;
|
|
24
|
+
let wsClient;
|
|
25
|
+
let port;
|
|
26
|
+
beforeEach(async () => {
|
|
27
|
+
const module = await testing_1.Test.createTestingModule({
|
|
28
|
+
imports: [
|
|
29
|
+
app_module_1.AppModule.forRoot({
|
|
30
|
+
context: (context) => {
|
|
31
|
+
const { authorization } = context?.connectionParams ?? {};
|
|
32
|
+
if (authorization) {
|
|
33
|
+
return { user: authorization.split('Bearer ')[1] };
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
subscriptions: {
|
|
40
|
+
'graphql-ws': {
|
|
41
|
+
onConnect: (context) => {
|
|
42
|
+
if (!context.connectionParams.authorization) {
|
|
43
|
+
return context.extra.socket.close(4000, 'Missing authorization');
|
|
44
|
+
}
|
|
45
|
+
const authorization = context.connectionParams
|
|
46
|
+
.authorization;
|
|
47
|
+
if (!authorization.startsWith('Bearer ')) {
|
|
48
|
+
throw new malformed_token_exception_1.MalformedTokenException();
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
],
|
|
56
|
+
}).compile();
|
|
57
|
+
app = module.createNestApplication();
|
|
58
|
+
await app.init();
|
|
59
|
+
await app.listen(0);
|
|
60
|
+
port = app.getHttpServer().address().port;
|
|
61
|
+
});
|
|
62
|
+
it('should receive an error if missing token', async () => {
|
|
63
|
+
wsClient = (0, graphql_ws_1.createClient)({
|
|
64
|
+
url: `ws://localhost:${port}/graphql`,
|
|
65
|
+
webSocketImpl: ws_1.default,
|
|
66
|
+
connectionParams: {},
|
|
67
|
+
retryAttempts: 0,
|
|
68
|
+
});
|
|
69
|
+
const closedPromise = new Promise((resolve) => {
|
|
70
|
+
wsClient.on('closed', (ev) => {
|
|
71
|
+
expect(ev.code).toEqual(4000);
|
|
72
|
+
expect(ev.reason).toEqual('Missing authorization');
|
|
73
|
+
resolve();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
const apolloClient = new apollo_client_1.default({
|
|
77
|
+
link: new graphql_ws_link_1.GraphQLWsLink(wsClient),
|
|
78
|
+
cache: new apollo_cache_inmemory_1.InMemoryCache(),
|
|
79
|
+
});
|
|
80
|
+
apolloClient
|
|
81
|
+
.subscribe({
|
|
82
|
+
query: subscriptionQuery,
|
|
83
|
+
variables: {
|
|
84
|
+
id: '1',
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
.subscribe({
|
|
88
|
+
next() { },
|
|
89
|
+
complete() { },
|
|
90
|
+
error() { },
|
|
91
|
+
});
|
|
92
|
+
await closedPromise;
|
|
93
|
+
});
|
|
94
|
+
it('should receive an error if token is malformed', async () => {
|
|
95
|
+
wsClient = (0, graphql_ws_1.createClient)({
|
|
96
|
+
url: `ws://localhost:${port}/graphql`,
|
|
97
|
+
webSocketImpl: ws_1.default,
|
|
98
|
+
connectionParams: {
|
|
99
|
+
authorization: 'wrong token',
|
|
100
|
+
},
|
|
101
|
+
retryAttempts: 0,
|
|
102
|
+
});
|
|
103
|
+
const closedPromise = new Promise((resolve) => {
|
|
104
|
+
wsClient.on('closed', (ev) => {
|
|
105
|
+
expect(ev.code).toEqual(4500);
|
|
106
|
+
expect(ev.reason).toEqual('Malformed token');
|
|
107
|
+
resolve();
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
const apolloClient = new apollo_client_1.default({
|
|
111
|
+
link: new graphql_ws_link_1.GraphQLWsLink(wsClient),
|
|
112
|
+
cache: new apollo_cache_inmemory_1.InMemoryCache(),
|
|
113
|
+
});
|
|
114
|
+
apolloClient
|
|
115
|
+
.subscribe({
|
|
116
|
+
query: subscriptionQuery,
|
|
117
|
+
variables: {
|
|
118
|
+
id: '1',
|
|
119
|
+
},
|
|
120
|
+
})
|
|
121
|
+
.subscribe({
|
|
122
|
+
next() { },
|
|
123
|
+
complete() { },
|
|
124
|
+
error() { },
|
|
125
|
+
});
|
|
126
|
+
await closedPromise;
|
|
127
|
+
});
|
|
128
|
+
it('should receive error on subscription if guard fails', async () => {
|
|
129
|
+
wsClient = (0, graphql_ws_1.createClient)({
|
|
130
|
+
url: `ws://localhost:${port}/graphql`,
|
|
131
|
+
webSocketImpl: ws_1.default,
|
|
132
|
+
connectionParams: {
|
|
133
|
+
authorization: 'Bearer notest',
|
|
134
|
+
},
|
|
135
|
+
retryAttempts: 0,
|
|
136
|
+
});
|
|
137
|
+
const apolloClient = new apollo_client_1.default({
|
|
138
|
+
link: new graphql_ws_link_1.GraphQLWsLink(wsClient),
|
|
139
|
+
cache: new apollo_cache_inmemory_1.InMemoryCache(),
|
|
140
|
+
});
|
|
141
|
+
await new Promise((resolve, reject) => {
|
|
142
|
+
apolloClient
|
|
143
|
+
.subscribe({
|
|
144
|
+
query: subscriptionQuery,
|
|
145
|
+
variables: {
|
|
146
|
+
id: '1',
|
|
147
|
+
},
|
|
148
|
+
})
|
|
149
|
+
.subscribe({
|
|
150
|
+
next() { },
|
|
151
|
+
complete() { },
|
|
152
|
+
error(error) {
|
|
153
|
+
try {
|
|
154
|
+
expect(error).toBeInstanceOf(apollo_client_1.ApolloError);
|
|
155
|
+
expect(error.graphQLErrors[0].message).toEqual('Forbidden resource');
|
|
156
|
+
expect(error.graphQLErrors[0].path[0]).toEqual('newNotification');
|
|
157
|
+
resolve();
|
|
158
|
+
}
|
|
159
|
+
catch (e) {
|
|
160
|
+
reject(e);
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
it('should connect to subscriptions', async () => {
|
|
167
|
+
wsClient = (0, graphql_ws_1.createClient)({
|
|
168
|
+
url: `ws://localhost:${port}/graphql`,
|
|
169
|
+
webSocketImpl: ws_1.default,
|
|
170
|
+
connectionParams: {
|
|
171
|
+
authorization: 'Bearer test',
|
|
172
|
+
},
|
|
173
|
+
retryAttempts: 0,
|
|
174
|
+
});
|
|
175
|
+
wsClient.on('connected', () => {
|
|
176
|
+
// timeout needed to allow the subscription to be established
|
|
177
|
+
setTimeout(() => {
|
|
178
|
+
notification_resolver_1.pubSub.publish('newNotification', {
|
|
179
|
+
newNotification: {
|
|
180
|
+
id: '2',
|
|
181
|
+
recipient: 'test',
|
|
182
|
+
message: 'wrong message!',
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
notification_resolver_1.pubSub.publish('newNotification', {
|
|
186
|
+
newNotification: {
|
|
187
|
+
id: '1',
|
|
188
|
+
recipient: 'someone-else',
|
|
189
|
+
message: 'wrong message!',
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
notification_resolver_1.pubSub.publish('newNotification', {
|
|
193
|
+
newNotification: {
|
|
194
|
+
id: '1',
|
|
195
|
+
recipient: 'test',
|
|
196
|
+
message: 'Hello graphql-ws',
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
}, 100);
|
|
200
|
+
});
|
|
201
|
+
const apolloClient = new apollo_client_1.default({
|
|
202
|
+
link: new graphql_ws_link_1.GraphQLWsLink(wsClient),
|
|
203
|
+
cache: new apollo_cache_inmemory_1.InMemoryCache(),
|
|
204
|
+
});
|
|
205
|
+
await new Promise((resolve, reject) => {
|
|
206
|
+
apolloClient
|
|
207
|
+
.subscribe({
|
|
208
|
+
query: subscriptionQuery,
|
|
209
|
+
variables: {
|
|
210
|
+
id: '1',
|
|
211
|
+
},
|
|
212
|
+
})
|
|
213
|
+
.subscribe({
|
|
214
|
+
next(value) {
|
|
215
|
+
try {
|
|
216
|
+
expect(value.data.newNotification.id).toEqual('1');
|
|
217
|
+
expect(value.data.newNotification.message).toEqual('Hello graphql-ws');
|
|
218
|
+
resolve();
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
reject(e);
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
complete() { },
|
|
225
|
+
error(error) {
|
|
226
|
+
reject(error);
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
afterEach(async () => {
|
|
232
|
+
try {
|
|
233
|
+
await wsClient.dispose();
|
|
234
|
+
}
|
|
235
|
+
catch { }
|
|
236
|
+
await app.close();
|
|
237
|
+
});
|
|
238
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApolloLink, Operation, FetchResult } from 'apollo-link';
|
|
2
|
+
import { Observable } from 'apollo-client/util/Observable';
|
|
3
|
+
import { Client } from 'graphql-ws';
|
|
4
|
+
export declare class GraphQLWsLink extends ApolloLink {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
request(operation: Operation): Observable<FetchResult>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=graphql-ws.link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-ws.link.d.ts","sourceRoot":"","sources":["../../../../../tests/subscriptions/utils/graphql-ws.link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;IAKnB,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAY9D"}
|