You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to vendure-config.ts file before the export. Maybe this is incorrect, i'm not to sure as i said i'm rather new and trying to get my head around this. It feels like i need to add something else to my angular frontend config to get it to work, or define something, but i'm not sure.
The full vendure config, only thing different from the original github version is the custom fields,
import {
dummyPaymentHandler,
DefaultJobQueuePlugin,
DefaultSearchPlugin,
VendureConfig,
LanguageCode
} from '@vendure/core';
import { defaultEmailHandlers, EmailPlugin } from '@vendure/email-plugin';
import { AssetServerPlugin } from '@vendure/asset-server-plugin';
import { AdminUiPlugin } from '@vendure/admin-ui-plugin';
import path from 'path';
export const config: VendureConfig = {
apiOptions: {
port: 3000,
adminApiPath: 'admin-api',
adminApiPlayground: {
settings: {
'request.credentials': 'include',
} as any,
},// turn this off for production
adminApiDebug: true, // turn this off for production
shopApiPath: 'shop-api',
shopApiPlayground: {
settings: {
'request.credentials': 'include',
} as any,
},// turn this off for production
shopApiDebug: true,// turn this off for production
},
authOptions: {
superadminCredentials: {
identifier: 'superadmin',
password: 'superadmin',
},
},
dbConnectionOptions: {
type: 'mysql',
synchronize: true, // turn this off for production
logging: false,
database: 'vendure',
host: 'localhost',
port: 3306,
username: 'root',
password: '',
migrations: [path.join(__dirname, '../migrations/*.ts')],
},
paymentOptions: {
paymentMethodHandlers: [dummyPaymentHandler],
},
customFields: {
Product: [
{
name: 'metaTitle',
type: 'string',
label: [ { languageCode: LanguageCode.en, value: 'Meta Title' } ]
},
{
name: 'metaDescription',
type: 'string',
label: [ { languageCode: LanguageCode.en, value: 'Meta Description' } ]
},
{
name: 'metaKeywords',
type: 'string',
label: [ { languageCode: LanguageCode.en, value: 'Meta Keywords' } ]
}
]
},
plugins: [
AssetServerPlugin.init({
route: 'assets',
assetUploadDir: path.join(__dirname, '../static/assets'),
}),
DefaultJobQueuePlugin,
DefaultSearchPlugin,
EmailPlugin.init({
devMode: true,
outputPath: path.join(__dirname, '../static/email/test-emails'),
route: 'mailbox',
handlers: defaultEmailHandlers,
templatePath: path.join(__dirname, '../static/email/templates'),
globalTemplateVars: {
// The following variables will change depending on your storefront implementation
fromAddress: '"example" <noreply@example.com>',
verifyEmailAddressUrl: 'http://localhost:8080/verify',
passwordResetUrl: 'http://localhost:8080/password-reset',
changeEmailAddressUrl: 'http://localhost:8080/verify-email-address-change'
},
}),
AdminUiPlugin.init({
route: 'admin',
port: 3002,
}),
],
};
any help would be appreciated, using mac Mojave, node v14.17.0 if that makes any difference.
The text was updated successfully, but these errors were encountered:
There are 2 aspects to the typings of the custom fields:
The typings of the server-side entities. This is covered by the declare module '@vendure/core' { ... code above. This is only needed when you are developing plugins for your Vendure server and need to access custom fields in a type-safe way.
So based on what you wrote above, you are interested in number 2 above. Since you have already added the custom field field selection to your graphql document, you should be able to npm run generate-types and then have the generated typings automatically updated with your custom fields.
Hi, i'm rather new to node & angular. I'm trying to create custom fields for a Product, but having trouble accessing the custom fields i've created.
Custom fields are defined in my vendure-config.ts below.
product-detail.component.ts
`
I have also added the customFields to the graphql query in product-detail.graphql.ts
However it keeps throwing the error:
error TS2339: Property 'customFields' does not exist on type '{ __typename?: "Product" | undefined; } & Pick<Product, "id" | "name" | "description"> & { variants: ({ __typename?: "ProductVariant" | undefined; } & Pick<ProductVariant, "id" | ... 3 more ... | "sku"> & { ...; })[]; featuredAsset?: ({ ...; } & ... 2 more ... & { ...; }) | undefined; assets: ({ ...; } & ... 2 more ...'.
I have referred to the docs on the customFields, i have tried adding
to vendure-config.ts file before the export. Maybe this is incorrect, i'm not to sure as i said i'm rather new and trying to get my head around this. It feels like i need to add something else to my angular frontend config to get it to work, or define something, but i'm not sure.
The full vendure config, only thing different from the original github version is the custom fields,
any help would be appreciated, using mac Mojave, node v14.17.0 if that makes any difference.
The text was updated successfully, but these errors were encountered: