The official Snippets extension for VulcanJS.
- JavaScript (.js)
- JavaScript React (.jsx)
Support for TypeScript and TypeScript React will be added when the core framework supports it.
Docs | Add a route with a registered component
addRoute({ name: '', path: '/path', componentName: '' });
Docs | Add a route with a direct component
addRoute({ name: '', path: '/path', component: });
Docs | Create a collection with custom queries & mutations
const MyDocuments = createCollection({
collectionName: 'MyDocuments',
typeName: 'MyDocument',
schema: mySchema,
resolvers: myResolvers,
mutations: myMutations,
});
Docs | Create a collection with default queries & mutations
const MyDocuments = createCollection({
collectionName: 'MyDocuments',
typeName: 'MyDocument',
schema: mySchema,
resolvers: getDefaultResolvers('MyDocument'),
mutations: getDefaultMutations('MyDocument'),
});
Docs | Register a new component
registerComponent({ name: 'MyComponent', component: MyComponent, hocs: [] });
Docs | Register a new fragment
registerFragment(`
fragment myFragment on MyType {
}
`)
Docs | Insert a field inside a schema
myFieldName: {
type: String,
label: 'MyFieldName',
optional: true,
canRead: [],
canCreate: [],
canUpdate: [],
},
Docs | Extend an exisiting collection with a new field
.addField({
fieldName: 'myFieldName',
fieldSchema: {
type: String,
optional: true,
canRead: [],
canCreate: [],
canUpdate: [],
},
});
Create an import from meteor/vulcan:core
import { } from 'meteor/vulcan:core';