How to use the @vendure/core/dist/config/collection/default-collection-filters.facetValueCollectionFilter.code function in @vendure/core

To help you get started, we’ve selected a few @vendure/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vendure-ecommerce / vendure / packages / elasticsearch-plugin / e2e / elasticsearch-plugin.e2e-spec.ts View on Github external
it('updates index when a Collection created', async () => {
                const { createCollection } = await adminClient.query<
                    CreateCollection.Mutation,
                    CreateCollection.Variables
                >(CREATE_COLLECTION, {
                    input: {
                        translations: [
                            {
                                languageCode: LanguageCode.en,
                                name: 'Photo',
                                description: '',
                            },
                        ],
                        filters: [
                            {
                                code: facetValueCollectionFilter.code,
                                arguments: [
                                    {
                                        name: 'facetValueIds',
                                        value: `["T_3"]`,
                                        type: 'facetValueIds',
                                    },
                                    {
                                        name: 'containsAny',
                                        value: `false`,
                                        type: 'boolean',
                                    },
                                ],
                            },
                        ],
                    },
                });
github vendure-ecommerce / vendure / packages / core / e2e / collection.e2e-spec.ts View on Github external
it('creates a 2nd level nested collection', async () => {
            const result = await adminClient.query(
                CREATE_COLLECTION,
                {
                    input: {
                        parentId: computersCollection.id,
                        translations: [{ languageCode: LanguageCode.en, name: 'Pear', description: '' }],
                        filters: [
                            {
                                code: facetValueCollectionFilter.code,
                                arguments: [
                                    {
                                        name: 'facetValueIds',
                                        value: `["${getFacetValueId('pear')}"]`,
                                        type: 'facetValueIds',
                                    },
                                    {
                                        name: 'containsAny',
                                        value: `false`,
                                        type: 'boolean',
                                    },
                                ],
                            },
                        ],
                    },
                },
github vendure-ecommerce / vendure / packages / elasticsearch-plugin / e2e / elasticsearch-plugin.e2e-spec.ts View on Github external
it('updates index when a Collection is changed', async () => {
                await adminClient.query(
                    UPDATE_COLLECTION,
                    {
                        input: {
                            id: 'T_2',
                            filters: [
                                {
                                    code: facetValueCollectionFilter.code,
                                    arguments: [
                                        {
                                            name: 'facetValueIds',
                                            value: `["T_4"]`,
                                            type: 'facetValueIds',
                                        },
                                        {
                                            name: 'containsAny',
                                            value: `false`,
                                            type: 'boolean',
                                        },
                                    ],
                                },
                            ],
                        },
                    },
github vendure-ecommerce / vendure / packages / core / e2e / default-search-plugin.e2e-spec.ts View on Github external
it('updates index when a Collection created', async () => {
                const { createCollection } = await adminClient.query<
                    CreateCollection.Mutation,
                    CreateCollection.Variables
                >(CREATE_COLLECTION, {
                    input: {
                        translations: [
                            {
                                languageCode: LanguageCode.en,
                                name: 'Photo',
                                description: '',
                            },
                        ],
                        filters: [
                            {
                                code: facetValueCollectionFilter.code,
                                arguments: [
                                    {
                                        name: 'facetValueIds',
                                        value: `["T_3"]`,
                                        type: 'facetValueIds',
                                    },
                                    {
                                        name: 'containsAny',
                                        value: `false`,
                                        type: 'boolean',
                                    },
                                ],
                            },
                        ],
                    },
                });
github vendure-ecommerce / vendure / packages / core / e2e / default-search-plugin.e2e-spec.ts View on Github external
it('updates index when a Collection is changed', async () => {
                await adminClient.query(
                    UPDATE_COLLECTION,
                    {
                        input: {
                            id: 'T_2',
                            filters: [
                                {
                                    code: facetValueCollectionFilter.code,
                                    arguments: [
                                        {
                                            name: 'facetValueIds',
                                            value: `["T_4"]`,
                                            type: 'facetValueIds',
                                        },
                                        {
                                            name: 'containsAny',
                                            value: `false`,
                                            type: 'boolean',
                                        },
                                    ],
                                },
                            ],
                        },
                    },
github vendure-ecommerce / vendure / packages / core / e2e / collection.e2e-spec.ts View on Github external
it('creates a root collection', async () => {
            const result = await adminClient.query(
                CREATE_COLLECTION,
                {
                    input: {
                        assetIds: [assets[0].id, assets[1].id],
                        featuredAssetId: assets[1].id,
                        filters: [
                            {
                                code: facetValueCollectionFilter.code,
                                arguments: [
                                    {
                                        name: 'facetValueIds',
                                        value: `["${getFacetValueId('electronics')}"]`,
                                        type: 'facetValueIds',
                                    },
                                    {
                                        name: 'containsAny',
                                        value: `false`,
                                        type: 'boolean',
                                    },
                                ],
                            },
                        ],
                        translations: [
                            { languageCode: LanguageCode.en, name: 'Electronics', description: '' },
github vendure-ecommerce / vendure / packages / core / e2e / shop-catalog.e2e-spec.ts View on Github external
beforeAll(async () => {
            const result = await adminClient.query(GET_FACET_LIST);
            const category = result.facets.items[0];
            const sportsEquipment = category.values.find(v => v.code === 'sports-equipment')!;
            const { createCollection } = await adminClient.query<
                CreateCollection.Mutation,
                CreateCollection.Variables
            >(CREATE_COLLECTION, {
                input: {
                    filters: [
                        {
                            code: facetValueCollectionFilter.code,
                            arguments: [
                                {
                                    name: 'facetValueIds',
                                    value: `["${sportsEquipment.id}"]`,
                                    type: 'facetValueIds',
                                },
                                {
                                    name: 'containsAny',
                                    value: `false`,
                                    type: 'boolean',
                                },
                            ],
                        },
                    ],
                    translations: [{ languageCode: LanguageCode.en, name: 'My Collection', description: '' }],
                },