diff --git a/.changeset/sharp-seahorses-deny.md b/.changeset/sharp-seahorses-deny.md new file mode 100644 index 0000000000..773cfaa234 --- /dev/null +++ b/.changeset/sharp-seahorses-deny.md @@ -0,0 +1,5 @@ +--- +"@graphcommerce/graphql-codegen-near-operation-file": patch +--- + +Do not require fragments to be marked @injectable but always accept @inject directives. diff --git a/docs/framework/plugins-graphql.md b/docs/framework/plugins-graphql.md index a1f3a78a4f..47ac9c08b4 100644 --- a/docs/framework/plugins-graphql.md +++ b/docs/framework/plugins-graphql.md @@ -41,7 +41,7 @@ query ProductList( } # Fragment used for a ProductListItem used when rendering any listing -fragment ProductListItem on ProductInterface @injectable { +fragment ProductListItem on ProductInterface { uid ...ProductLink sku @@ -59,8 +59,8 @@ fragment ProductListItem on ProductInterface @injectable { ## How to modify an existing query? -Some Fragments inside GraphCommerce have been marked as `@injectable` which -allows you to inject our own fields in the fragments. +Fragments inside GraphCommerce allows you to inject our own fields in the +fragments. ```graphql fragment MyCustomFragment on ProductInterface diff --git a/packages/hygraph-dynamic-rows/graphql/DynamicRow.graphql b/packages/hygraph-dynamic-rows/graphql/DynamicRow.graphql index 75cce77337..b207d0e527 100644 --- a/packages/hygraph-dynamic-rows/graphql/DynamicRow.graphql +++ b/packages/hygraph-dynamic-rows/graphql/DynamicRow.graphql @@ -1,4 +1,4 @@ -fragment DynamicRow on DynamicRow @injectable { +fragment DynamicRow on DynamicRow { placement target { ... on Node { diff --git a/packages/hygraph-ui/components/Asset/Asset.graphql b/packages/hygraph-ui/components/Asset/Asset.graphql index 154773cbcf..a8607926e3 100644 --- a/packages/hygraph-ui/components/Asset/Asset.graphql +++ b/packages/hygraph-ui/components/Asset/Asset.graphql @@ -1,4 +1,4 @@ -fragment Asset on Asset @injectable { +fragment Asset on Asset { url width height diff --git a/packages/hygraph-ui/graphql/HygraphPage.graphql b/packages/hygraph-ui/graphql/HygraphPage.graphql index 859347c93e..edf19d40d1 100644 --- a/packages/hygraph-ui/graphql/HygraphPage.graphql +++ b/packages/hygraph-ui/graphql/HygraphPage.graphql @@ -1,4 +1,4 @@ -fragment HygraphPage on Page @injectable { +fragment HygraphPage on Page { title metaTitle metaDescription diff --git a/packages/hygraph-ui/graphql/PageLink.graphql b/packages/hygraph-ui/graphql/PageLink.graphql index 5ae326f1e2..e6da39e833 100644 --- a/packages/hygraph-ui/graphql/PageLink.graphql +++ b/packages/hygraph-ui/graphql/PageLink.graphql @@ -1,4 +1,4 @@ -fragment PageLink on PageLink @injectable { +fragment PageLink on PageLink { title url description { diff --git a/packages/magento-cart-billing-address/Api/CartBillingAddress.graphql b/packages/magento-cart-billing-address/Api/CartBillingAddress.graphql index 5c7717dd5a..7dc20599c1 100644 --- a/packages/magento-cart-billing-address/Api/CartBillingAddress.graphql +++ b/packages/magento-cart-billing-address/Api/CartBillingAddress.graphql @@ -1,4 +1,4 @@ -fragment CartBillingAddress on Cart @injectable { +fragment CartBillingAddress on Cart { id __typename billing_address { diff --git a/packages/magento-cart-checkout/queries/CartPageFragment.graphql b/packages/magento-cart-checkout/queries/CartPageFragment.graphql index 2674b4b540..c4e781e0bd 100644 --- a/packages/magento-cart-checkout/queries/CartPageFragment.graphql +++ b/packages/magento-cart-checkout/queries/CartPageFragment.graphql @@ -1,4 +1,4 @@ -fragment CartPageFragment on Cart @injectable { +fragment CartPageFragment on Cart { id __typename email diff --git a/packages/magento-cart-checkout/queries/ShippingPageFragment.graphql b/packages/magento-cart-checkout/queries/ShippingPageFragment.graphql index e38f8efa8c..6e6ef3b1ca 100644 --- a/packages/magento-cart-checkout/queries/ShippingPageFragment.graphql +++ b/packages/magento-cart-checkout/queries/ShippingPageFragment.graphql @@ -1,4 +1,4 @@ -fragment ShippingPageFragment on Cart @injectable { +fragment ShippingPageFragment on Cart { ...BillingAddress ...ShippingAddress ...CartSummary diff --git a/packages/magento-cart-coupon/Api/Coupon.graphql b/packages/magento-cart-coupon/Api/Coupon.graphql index 5274d9fe75..ab36e52024 100644 --- a/packages/magento-cart-coupon/Api/Coupon.graphql +++ b/packages/magento-cart-coupon/Api/Coupon.graphql @@ -1,4 +1,4 @@ -fragment Coupon on Cart @injectable { +fragment Coupon on Cart { id __typename applied_coupons { diff --git a/packages/magento-cart-email/Api/GuestEmailChanged.graphql b/packages/magento-cart-email/Api/GuestEmailChanged.graphql index 74d20fceff..3a66f0f6a0 100644 --- a/packages/magento-cart-email/Api/GuestEmailChanged.graphql +++ b/packages/magento-cart-email/Api/GuestEmailChanged.graphql @@ -1,3 +1,3 @@ -fragment GuestEmailChanged on Cart @injectable { +fragment GuestEmailChanged on Cart { id } diff --git a/packages/magento-cart-items/Api/CartItem.graphql b/packages/magento-cart-items/Api/CartItem.graphql index 227ee1c160..950077e5cb 100644 --- a/packages/magento-cart-items/Api/CartItem.graphql +++ b/packages/magento-cart-items/Api/CartItem.graphql @@ -1,4 +1,4 @@ -fragment CartItem on CartItemInterface @injectable { +fragment CartItem on CartItemInterface { uid quantity __typename diff --git a/packages/magento-cart-items/Api/CartItems.graphql b/packages/magento-cart-items/Api/CartItems.graphql index 7b17aca1ad..2e8057eaa6 100644 --- a/packages/magento-cart-items/Api/CartItems.graphql +++ b/packages/magento-cart-items/Api/CartItems.graphql @@ -1,4 +1,4 @@ -fragment CartItems on Cart @injectable { +fragment CartItems on Cart { id items { uid diff --git a/packages/magento-cart-payment-method/Api/AvailablePaymentMethod/AvailablePaymentMethod.graphql b/packages/magento-cart-payment-method/Api/AvailablePaymentMethod/AvailablePaymentMethod.graphql index 776b6af32c..5666877f29 100644 --- a/packages/magento-cart-payment-method/Api/AvailablePaymentMethod/AvailablePaymentMethod.graphql +++ b/packages/magento-cart-payment-method/Api/AvailablePaymentMethod/AvailablePaymentMethod.graphql @@ -1,4 +1,4 @@ -fragment AvailablePaymentMethod on AvailablePaymentMethod @injectable { +fragment AvailablePaymentMethod on AvailablePaymentMethod { code title } diff --git a/packages/magento-cart-payment-method/Api/PaymentMethodContext.graphql b/packages/magento-cart-payment-method/Api/PaymentMethodContext.graphql index 0420b5e97c..30cd511dc6 100644 --- a/packages/magento-cart-payment-method/Api/PaymentMethodContext.graphql +++ b/packages/magento-cart-payment-method/Api/PaymentMethodContext.graphql @@ -1,4 +1,4 @@ -fragment PaymentMethodContext on Cart @injectable { +fragment PaymentMethodContext on Cart { id available_payment_methods { ...AvailablePaymentMethod diff --git a/packages/magento-cart-payment-method/Api/PaymentMethodUpdated.graphql b/packages/magento-cart-payment-method/Api/PaymentMethodUpdated.graphql index 3f99cb26cd..aa103e31ad 100644 --- a/packages/magento-cart-payment-method/Api/PaymentMethodUpdated.graphql +++ b/packages/magento-cart-payment-method/Api/PaymentMethodUpdated.graphql @@ -1,4 +1,4 @@ -fragment PaymentMethodUpdated on Cart @injectable { +fragment PaymentMethodUpdated on Cart { id selected_payment_method { ...SelectedPaymentMethod diff --git a/packages/magento-cart-payment-method/Api/SelectedPaymentMethod/SelectedPaymentMethod.graphql b/packages/magento-cart-payment-method/Api/SelectedPaymentMethod/SelectedPaymentMethod.graphql index 497516322e..ba24c40125 100644 --- a/packages/magento-cart-payment-method/Api/SelectedPaymentMethod/SelectedPaymentMethod.graphql +++ b/packages/magento-cart-payment-method/Api/SelectedPaymentMethod/SelectedPaymentMethod.graphql @@ -1,4 +1,4 @@ -fragment SelectedPaymentMethod on SelectedPaymentMethod @injectable { +fragment SelectedPaymentMethod on SelectedPaymentMethod { code title } diff --git a/packages/magento-cart-shipping-address/Api/BillingAddress.graphql b/packages/magento-cart-shipping-address/Api/BillingAddress.graphql index 19d7c30633..7754f67b94 100644 --- a/packages/magento-cart-shipping-address/Api/BillingAddress.graphql +++ b/packages/magento-cart-shipping-address/Api/BillingAddress.graphql @@ -1,4 +1,4 @@ -fragment BillingAddress on Cart @injectable { +fragment BillingAddress on Cart { id billing_address { ...CartAddress diff --git a/packages/magento-cart-shipping-address/Api/ShippingAddress.graphql b/packages/magento-cart-shipping-address/Api/ShippingAddress.graphql index 85935f9868..fc66be74a7 100644 --- a/packages/magento-cart-shipping-address/Api/ShippingAddress.graphql +++ b/packages/magento-cart-shipping-address/Api/ShippingAddress.graphql @@ -1,4 +1,4 @@ -fragment ShippingAddress on Cart @injectable { +fragment ShippingAddress on Cart { id is_virtual shipping_addresses { diff --git a/packages/magento-cart-shipping-method/Api/AvailableShippingMethods.graphql b/packages/magento-cart-shipping-method/Api/AvailableShippingMethods.graphql index ec11a9d746..30ecf72e28 100644 --- a/packages/magento-cart-shipping-method/Api/AvailableShippingMethods.graphql +++ b/packages/magento-cart-shipping-method/Api/AvailableShippingMethods.graphql @@ -1,4 +1,4 @@ -fragment AvailableShippingMethods on Cart @injectable @inject(into: ["ShippingAddress"]) { +fragment AvailableShippingMethods on Cart @inject(into: ["ShippingAddress"]) { shipping_addresses { available_shipping_methods { ...AvailableShippingMethod diff --git a/packages/magento-cart-shipping-method/Api/ShippingMethodSelected.graphql b/packages/magento-cart-shipping-method/Api/ShippingMethodSelected.graphql index b6b7b3bb2a..98cfebbcc7 100644 --- a/packages/magento-cart-shipping-method/Api/ShippingMethodSelected.graphql +++ b/packages/magento-cart-shipping-method/Api/ShippingMethodSelected.graphql @@ -1,4 +1,4 @@ -fragment ShippingMethodSelected on Cart @injectable { +fragment ShippingMethodSelected on Cart { id shipping_addresses { selected_shipping_method { diff --git a/packages/magento-cart/Api/CartItemCountChanged.graphql b/packages/magento-cart/Api/CartItemCountChanged.graphql index 8031a14964..5170a6380a 100644 --- a/packages/magento-cart/Api/CartItemCountChanged.graphql +++ b/packages/magento-cart/Api/CartItemCountChanged.graphql @@ -1,4 +1,4 @@ -fragment CartItemCountChanged on Cart @injectable { +fragment CartItemCountChanged on Cart { __typename id total_quantity diff --git a/packages/magento-cart/components/CartStartCheckout/CartStartCheckout.graphql b/packages/magento-cart/components/CartStartCheckout/CartStartCheckout.graphql index d10cabbae2..557c9cac00 100644 --- a/packages/magento-cart/components/CartStartCheckout/CartStartCheckout.graphql +++ b/packages/magento-cart/components/CartStartCheckout/CartStartCheckout.graphql @@ -1,4 +1,4 @@ -fragment CartStartCheckout on Cart @injectable { +fragment CartStartCheckout on Cart { prices { grand_total { ...Money diff --git a/packages/magento-cart/components/CartTotals/CartTotals.graphql b/packages/magento-cart/components/CartTotals/CartTotals.graphql index bc64d20e98..2bbe48baae 100644 --- a/packages/magento-cart/components/CartTotals/CartTotals.graphql +++ b/packages/magento-cart/components/CartTotals/CartTotals.graphql @@ -1,6 +1,4 @@ -fragment CartTotals on Cart -@injectable -@inject(into: ["CartItemCountChanged", "PaymentMethodUpdated"]) { +fragment CartTotals on Cart @inject(into: ["CartItemCountChanged", "PaymentMethodUpdated"]) { shipping_addresses { selected_shipping_method { carrier_code diff --git a/packages/magento-cart/components/OrderSucces/OrderSuccesPage.graphql b/packages/magento-cart/components/OrderSucces/OrderSuccesPage.graphql index 3a2a6e7d96..fa5fe8e8e9 100644 --- a/packages/magento-cart/components/OrderSucces/OrderSuccesPage.graphql +++ b/packages/magento-cart/components/OrderSucces/OrderSuccesPage.graphql @@ -1,4 +1,4 @@ -fragment OrderSuccesPage on Cart @injectable { +fragment OrderSuccesPage on Cart { ...CartItems ...CartTotals } diff --git a/packages/magento-category/components/CategoryDescription/CategoryDescription.graphql b/packages/magento-category/components/CategoryDescription/CategoryDescription.graphql index 3acc11c5a3..cd23c41c4c 100644 --- a/packages/magento-category/components/CategoryDescription/CategoryDescription.graphql +++ b/packages/magento-category/components/CategoryDescription/CategoryDescription.graphql @@ -1,4 +1,4 @@ -fragment CategoryDescription on CategoryTree @injectable { +fragment CategoryDescription on CategoryTree { uid description name diff --git a/packages/magento-category/components/CategoryHeroNav/CategoryHeroNav.graphql b/packages/magento-category/components/CategoryHeroNav/CategoryHeroNav.graphql index f1ef7558a2..f1663bcb9c 100644 --- a/packages/magento-category/components/CategoryHeroNav/CategoryHeroNav.graphql +++ b/packages/magento-category/components/CategoryHeroNav/CategoryHeroNav.graphql @@ -1,4 +1,4 @@ -fragment CategoryHeroNav on CategoryTree @injectable { +fragment CategoryHeroNav on CategoryTree { uid level is_anchor diff --git a/packages/magento-category/queries/CategoryPathFragment.graphql b/packages/magento-category/queries/CategoryPathFragment.graphql index c05f015e17..aab57beda2 100644 --- a/packages/magento-category/queries/CategoryPathFragment.graphql +++ b/packages/magento-category/queries/CategoryPathFragment.graphql @@ -1,4 +1,4 @@ -fragment CategoryPathFragment on CategoryTree @injectable { +fragment CategoryPathFragment on CategoryTree { uid url_path children { diff --git a/packages/magento-category/queries/NavigationItem.graphql b/packages/magento-category/queries/NavigationItem.graphql index c898e10228..4bc87197ae 100644 --- a/packages/magento-category/queries/NavigationItem.graphql +++ b/packages/magento-category/queries/NavigationItem.graphql @@ -1,4 +1,4 @@ -fragment NavigationItem on CategoryTree @injectable { +fragment NavigationItem on CategoryTree { uid include_in_menu name diff --git a/packages/magento-cms/CmsPageContent.graphql b/packages/magento-cms/CmsPageContent.graphql index c4819f2669..e6773fc43b 100644 --- a/packages/magento-cms/CmsPageContent.graphql +++ b/packages/magento-cms/CmsPageContent.graphql @@ -1,4 +1,4 @@ -fragment CmsPageContent on CmsPage @injectable { +fragment CmsPageContent on CmsPage { content_heading content } diff --git a/packages/magento-customer/graphql/AccountDashboardCustomer.graphql b/packages/magento-customer/graphql/AccountDashboardCustomer.graphql index 1ddfd0e332..6d3a96b0db 100644 --- a/packages/magento-customer/graphql/AccountDashboardCustomer.graphql +++ b/packages/magento-customer/graphql/AccountDashboardCustomer.graphql @@ -1,3 +1,3 @@ -fragment AccountDashboardCustomer on Customer @injectable { +fragment AccountDashboardCustomer on Customer { email } diff --git a/packages/magento-customer/hooks/CustomerTokenFragment.graphql b/packages/magento-customer/hooks/CustomerTokenFragment.graphql index 332ed806a2..b221b7349c 100644 --- a/packages/magento-customer/hooks/CustomerTokenFragment.graphql +++ b/packages/magento-customer/hooks/CustomerTokenFragment.graphql @@ -1,4 +1,4 @@ -fragment CustomerTokenFragment on CustomerToken @injectable { +fragment CustomerTokenFragment on CustomerToken { __typename token } diff --git a/packages/magento-product-configurable/graphql/ConfigurableOptions.graphql b/packages/magento-product-configurable/graphql/ConfigurableOptions.graphql index 6ffa355e12..35ba3bd64d 100644 --- a/packages/magento-product-configurable/graphql/ConfigurableOptions.graphql +++ b/packages/magento-product-configurable/graphql/ConfigurableOptions.graphql @@ -1,4 +1,4 @@ -fragment ConfigurableOptions on ConfigurableProduct @injectable { +fragment ConfigurableOptions on ConfigurableProduct { __typename uid sku diff --git a/packages/magento-product-configurable/graphql/ConfigurableOptionsSelection.graphql b/packages/magento-product-configurable/graphql/ConfigurableOptionsSelection.graphql index a383a8dded..2e37e82ad4 100644 --- a/packages/magento-product-configurable/graphql/ConfigurableOptionsSelection.graphql +++ b/packages/magento-product-configurable/graphql/ConfigurableOptionsSelection.graphql @@ -1,4 +1,4 @@ -fragment ConfigurableOptionsSelection on ConfigurableProduct @injectable { +fragment ConfigurableOptionsSelection on ConfigurableProduct { configurable_product_options_selection(configurableOptionValueUids: $selectedOptions) { __typename configurable_options { diff --git a/packages/magento-product/Api/ProductListItem.graphql b/packages/magento-product/Api/ProductListItem.graphql index e827721f96..bb26a139aa 100644 --- a/packages/magento-product/Api/ProductListItem.graphql +++ b/packages/magento-product/Api/ProductListItem.graphql @@ -1,4 +1,4 @@ -fragment ProductListItem on ProductInterface @injectable { +fragment ProductListItem on ProductInterface { uid ...ProductLink sku diff --git a/packages/magento-product/Api/ProductPageItem.graphql b/packages/magento-product/Api/ProductPageItem.graphql index cee2330d9d..928d67408d 100644 --- a/packages/magento-product/Api/ProductPageItem.graphql +++ b/packages/magento-product/Api/ProductPageItem.graphql @@ -1,4 +1,4 @@ -fragment ProductPageItem on ProductInterface @injectable { +fragment ProductPageItem on ProductInterface { __typename uid ...ProductListItem diff --git a/packages/magento-product/components/AddProductsToCart/UseAddProductsToCartAction.graphql b/packages/magento-product/components/AddProductsToCart/UseAddProductsToCartAction.graphql index 82493b7cf2..980939a245 100644 --- a/packages/magento-product/components/AddProductsToCart/UseAddProductsToCartAction.graphql +++ b/packages/magento-product/components/AddProductsToCart/UseAddProductsToCartAction.graphql @@ -1,4 +1,4 @@ -fragment UseAddProductsToCartAction on ProductInterface @injectable { +fragment UseAddProductsToCartAction on ProductInterface { uid sku only_x_left_in_stock diff --git a/packages/magento-product/components/JsonLdProduct/JsonLdProduct.graphql b/packages/magento-product/components/JsonLdProduct/JsonLdProduct.graphql index 5e94d9468e..8e9b1215d9 100644 --- a/packages/magento-product/components/JsonLdProduct/JsonLdProduct.graphql +++ b/packages/magento-product/components/JsonLdProduct/JsonLdProduct.graphql @@ -1,4 +1,4 @@ -fragment JsonLdProduct on ProductInterface @inject(into: ["ProductPageItem"]) @injectable { +fragment JsonLdProduct on ProductInterface @inject(into: ["ProductPageItem"]) { uid name sku diff --git a/packages/magento-product/components/ProductCustomizable/ProductCustomizable.graphql b/packages/magento-product/components/ProductCustomizable/ProductCustomizable.graphql index 26234c7ae0..105c64201f 100644 --- a/packages/magento-product/components/ProductCustomizable/ProductCustomizable.graphql +++ b/packages/magento-product/components/ProductCustomizable/ProductCustomizable.graphql @@ -1,4 +1,4 @@ -fragment ProductCustomizable on CustomizableProductInterface @injectable { +fragment ProductCustomizable on CustomizableProductInterface { options { uid __typename diff --git a/packages/magento-product/components/ProductPageDescription/ComplexTextValue.graphql b/packages/magento-product/components/ProductPageDescription/ComplexTextValue.graphql index 81e936beb1..8e0cb62b29 100644 --- a/packages/magento-product/components/ProductPageDescription/ComplexTextValue.graphql +++ b/packages/magento-product/components/ProductPageDescription/ComplexTextValue.graphql @@ -1,4 +1,4 @@ -fragment ComplexTextValue on ComplexTextValue @injectable { +fragment ComplexTextValue on ComplexTextValue { html __typename } diff --git a/packages/magento-product/components/ProductPageMeta/ProductPageMeta.graphql b/packages/magento-product/components/ProductPageMeta/ProductPageMeta.graphql index 23a454eb90..9caebe59ca 100644 --- a/packages/magento-product/components/ProductPageMeta/ProductPageMeta.graphql +++ b/packages/magento-product/components/ProductPageMeta/ProductPageMeta.graphql @@ -1,4 +1,4 @@ -fragment ProductPageMeta on ProductInterface @injectable { +fragment ProductPageMeta on ProductInterface { ...ProductLink sku name diff --git a/packages/magento-store/StoreConfigFragment.graphql b/packages/magento-store/StoreConfigFragment.graphql index 19171622fd..a5bd2d9f58 100644 --- a/packages/magento-store/StoreConfigFragment.graphql +++ b/packages/magento-store/StoreConfigFragment.graphql @@ -1,4 +1,4 @@ -fragment StoreConfigFragment on StoreConfig @injectable { +fragment StoreConfigFragment on StoreConfig { website_name store_code store_name diff --git a/packagesDev/graphql-codegen-near-operation-file/dist/directive/injectable.js b/packagesDev/graphql-codegen-near-operation-file/dist/directive/injectable.js index 428deb8538..170e8f5748 100644 --- a/packagesDev/graphql-codegen-near-operation-file/dist/directive/injectable.js +++ b/packagesDev/graphql-codegen-near-operation-file/dist/directive/injectable.js @@ -97,14 +97,14 @@ function injectInjectable(injectables, injector) { }); }); if (!found) - throwInjectError(injectVal, `fragment ${target} @injectable { ... } can not be found or isn't injectable`); + throwInjectError(injectVal, `fragment ${target} { ... } can not be found`); }); } function injectableDirective(documentFiles) { const documents = documentFiles .map(({ document }) => document) .filter((doc) => doc); - const injectables = documents.filter((d) => isFragment(d) && hasInjectableDirective(d)); + const injectables = documents.filter((d) => isFragment(d)); const injectors = documents.filter((d) => isFragment(d) && hasInjectDirective(d)); injectors.forEach((d) => injectInjectable(injectables, d)); return documentFiles; diff --git a/packagesDev/graphql-codegen-near-operation-file/src/directive/injectable.graphqls b/packagesDev/graphql-codegen-near-operation-file/src/directive/injectable.graphqls index 811093b32b..7fd995af29 100644 --- a/packagesDev/graphql-codegen-near-operation-file/src/directive/injectable.graphqls +++ b/packagesDev/graphql-codegen-near-operation-file/src/directive/injectable.graphqls @@ -1,4 +1,6 @@ """ +DEPRECATED, CAN BE COMPLETELY OMITTED + Defines wheter a Fragment can be injected ```graphql @@ -10,7 +12,7 @@ fragment MyInjectableFragment on Model @injectable { directive @injectable on FRAGMENT_DEFINITION """ -Defines whether a Fragment injects into an @injectable +Defines whether a Fragment injects into another Fragment ```graphql fragment MyFragment on Model @inject(into ["MyInjectableFragment"]) { diff --git a/packagesDev/graphql-codegen-near-operation-file/src/directive/injectable.ts b/packagesDev/graphql-codegen-near-operation-file/src/directive/injectable.ts index c01253e4a3..06793dcb48 100644 --- a/packagesDev/graphql-codegen-near-operation-file/src/directive/injectable.ts +++ b/packagesDev/graphql-codegen-near-operation-file/src/directive/injectable.ts @@ -104,11 +104,7 @@ function injectInjectable(injectables: DocumentNode[], injector: DocumentNode) { }, }) }) - if (!found) - throwInjectError( - injectVal, - `fragment ${target} @injectable { ... } can not be found or isn't injectable`, - ) + if (!found) throwInjectError(injectVal, `fragment ${target} { ... } can not be found`) }) } @@ -117,7 +113,7 @@ export function injectableDirective(documentFiles: Types.DocumentFile[]) { .map(({ document }) => document) .filter((doc) => doc) as DocumentNode[] - const injectables = documents.filter((d) => isFragment(d) && hasInjectableDirective(d)) + const injectables = documents.filter((d) => isFragment(d)) const injectors = documents.filter((d) => isFragment(d) && hasInjectDirective(d))