mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-28 19:45:22 +00:00
feat: add query parameter while calling gql api from form view
re #608 Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
@@ -29,11 +29,14 @@ export default class GqlApi {
|
||||
return data.data.data[this.gqlQueryCountName]
|
||||
}
|
||||
|
||||
post(url, params) {
|
||||
post(url, data, {
|
||||
params = {}
|
||||
} = {}) {
|
||||
return this.$axios({
|
||||
url: `${url}`,
|
||||
method: 'post',
|
||||
data: params
|
||||
data,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -195,15 +198,15 @@ export default class GqlApi {
|
||||
return data1.data.data[this.gqlMutationUpdateName]
|
||||
}
|
||||
|
||||
async insert(data, params = {}) {
|
||||
async insert(data, params) {
|
||||
const data1 = await this.post(`/nc/${this.$ctx.projectId}/v1/graphql`, {
|
||||
query: `mutation create($data:${this.tableCamelized}Input){
|
||||
${this.gqlMutationCreateName}(data: $data){${this.gqlReqBody}${await this.gqlRelationReqBody(params)}}
|
||||
${this.gqlMutationCreateName}(data: $data){${this.gqlReqBody}${await this.gqlRelationReqBody({})}}
|
||||
}`,
|
||||
variables: {
|
||||
data
|
||||
}
|
||||
})
|
||||
}, params)
|
||||
return data1.data.data[this.gqlMutationCreateName]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user