Skip to content

Commit

Permalink
fix(admin): remove exportedFiles field (#7835)
Browse files Browse the repository at this point in the history
(cherry picked from commit ee382a4)
  • Loading branch information
ajeetdsouza committed May 20, 2021
1 parent 1fe99f2 commit 5a273b1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
1 change: 0 additions & 1 deletion graphql/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ const (
}
type ExportPayload {
exportedFiles: [String]
response: Response
taskId: String
}
Expand Down
18 changes: 13 additions & 5 deletions graphql/e2e/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,24 +603,24 @@ func TestApolloServiceResolver(t *testing.T) {
startDate: String
endDate: String
}
type Astronaut @key(fields: "id") @extends {
id: ID! @external
missions: [Mission]
}
type User @remote {
id: ID!
name: String!
}
type Car @auth(
password: { rule: "{$ROLE: { eq: \"Admin\" } }"}
){
id: ID!
name: String!
}
type Query {
getMyFavoriteUsers(id: ID!): [User] @custom(http: {
url: "http://my-api.com",
Expand Down Expand Up @@ -672,13 +672,21 @@ func TestDeleteSchemaAndExport(t *testing.T) {
exportReq := &common.GraphQLParams{
Query: `mutation {
export(input: {format: "rdf"}) {
exportedFiles
response { code }
taskId
}
}`,
}
exportGqlResp := exportReq.ExecuteAsPost(t, groupOneAdminServer)
common.RequireNoGQLErrors(t, exportGqlResp)

var data interface{}
require.NoError(t, json.Unmarshal(exportGqlResp.Data, &data))

require.Equal(t, "Success", testutil.JsonGet(data, "export", "response", "code").(string))
taskId := testutil.JsonGet(data, "export", "taskId").(string)
testutil.WaitForTask(t, taskId, false)

// applying a new schema should still work
newSchemaResp := common.AssertUpdateGQLSchemaSuccess(t, groupOneHTTP, schema, nil)
// we can assert that the uid allocated to new schema isn't same as the uid for old schema
Expand Down
13 changes: 8 additions & 5 deletions worker/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,8 @@ func TestExportJson(t *testing.T) {

const exportRequest = `mutation export($format: String!) {
export(input: {format: $format}) {
exportedFiles
response {
code
}
response { code }
taskId
}
}`

Expand All @@ -427,7 +425,12 @@ func TestExportFormat(t *testing.T) {

resp, err := http.Post(adminUrl, "application/json", bytes.NewBuffer(b))
require.NoError(t, err)
testutil.RequireNoGraphQLErrors(t, resp)

var data interface{}
require.NoError(t, json.NewDecoder(resp.Body).Decode(&data))
require.Equal(t, "Success", testutil.JsonGet(data, "data", "export", "response", "code").(string))
taskId := testutil.JsonGet(data, "data", "export", "taskId").(string)
testutil.WaitForTask(t, taskId, false)

params.Variables["format"] = "rdf"
b, err = json.Marshal(params)
Expand Down

0 comments on commit 5a273b1

Please sign in to comment.