(m schema.Mutation)
| 98 | } |
| 99 | |
| 100 | func getExportInput(m schema.Mutation) (*exportInput, error) { |
| 101 | inputArg := m.ArgValue(schema.InputArgName) |
| 102 | inputByts, err := json.Marshal(inputArg) |
| 103 | if err != nil { |
| 104 | return nil, schema.GQLWrapf(err, "couldn't get input argument") |
| 105 | } |
| 106 | |
| 107 | var input exportInput |
| 108 | err = json.Unmarshal(inputByts, &input) |
| 109 | |
| 110 | // Export everything if namespace is not specified. |
| 111 | if v, ok := inputArg.(map[string]interface{}); ok { |
| 112 | if _, ok := v["namespace"]; !ok { |
| 113 | input.Namespace = notSet |
| 114 | } |
| 115 | } |
| 116 | return &input, schema.GQLWrapf(err, "couldn't get input argument") |
| 117 | } |
no test coverage detected
searching dependent graphs…