MCPcopy
hub / github.com/dgraph-io/dgraph / UpdateGQLSchema

Method UpdateGQLSchema

dgraphapi/cluster.go:604–622  ·  view source on GitHub ↗

UpdateGQLSchema updates graphql schema for a given HTTP client

(sch string)

Source from the content-addressed store, hash-verified

602
603// UpdateGQLSchema updates graphql schema for a given HTTP client
604func (hc *HTTPClient) UpdateGQLSchema(sch string) error {
605 const query = `mutation updateGQLSchema($sch: String!) {
606 updateGQLSchema(input: { set: { schema: $sch }}) {
607 gqlSchema {
608 id
609 }
610 }
611 }`
612 params := GraphQLParams{
613 Query: query,
614 Variables: map[string]interface{}{
615 "sch": sch,
616 },
617 }
618 if _, err := hc.RunGraphqlQuery(params, true); err != nil {
619 return err
620 }
621 return nil
622}
623
624// PostPersistentQuery stores a persisted query
625func (hc *HTTPClient) PostPersistentQuery(query, sha string) ([]byte, error) {

Calls 1

RunGraphqlQueryMethod · 0.95