Bind vue-form-generator and GraphQl
Plugin realize query building for GraphQL based on schema, also it makes model from schema with groups.
API
method (arguments) {return}
$buildModel (schema: object, [model: object ]) {model: object}
$buildQuery (schema: object, model: object, options*: object) {query: function, vars: function}
options: {
type: 'query' or `mutation` (default),
fields: `fields that backend will return, comma separated`
}
How to use
1 Include plugin to your project: import vfgg from 'vue-form-generator-graphql'
, Vue.use(vfgg)
2 First, build model based on schema:
thisschema = JSON;thismodel = this;
It can takes array of fields or groups
3 Then collect form data and create query/mutation:
const qb = this; this$apollo
query/mutation name will be prefixed with 'Fetch' (ex. 'FetchQueryName')