(w http.ResponseWriter, r *http.Request)
| 665 | } |
| 666 | |
| 667 | func adminSchemaHandler(w http.ResponseWriter, r *http.Request) { |
| 668 | if commonHandler(w, r) { |
| 669 | return |
| 670 | } |
| 671 | |
| 672 | b := readRequest(w, r) |
| 673 | if b == nil { |
| 674 | return |
| 675 | } |
| 676 | |
| 677 | gqlReq := &schema.Request{ |
| 678 | Query: ` |
| 679 | mutation updateGqlSchema($sch: String!) { |
| 680 | updateGQLSchema(input: { |
| 681 | set: { |
| 682 | schema: $sch |
| 683 | } |
| 684 | }) { |
| 685 | gqlSchema { |
| 686 | id |
| 687 | } |
| 688 | } |
| 689 | }`, |
| 690 | Variables: map[string]interface{}{"sch": string(b)}, |
| 691 | } |
| 692 | |
| 693 | response := resolveWithAdminServer(gqlReq, r, adminServer) |
| 694 | if len(response.Errors) > 0 { |
| 695 | x.SetStatus(w, x.Error, response.Errors.Error()) |
| 696 | return |
| 697 | } |
| 698 | |
| 699 | writeSuccessResponse(w, r) |
| 700 | } |
| 701 | |
| 702 | func graphqlProbeHandler(gqlHealthStore *admin.GraphQLHealthStore, globalEpoch map[uint64]*uint64) http.Handler { |
| 703 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected