Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit d9a3372

Browse files
committed
Fix underscored field names
1 parent 1383f3a commit d9a3372

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

app/models/graph/types/film.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ module Types
2828
field :releaseDate, !types.String,
2929
"The ISO 8601 date format of film release at original creator country.", property: :release_date
3030

31-
field :created_at, !types.String, "The ISO 8601 date format of the time that this resource was created."
32-
field :updated_at, !types.String, "The ISO 8601 date format of the time that this resource was edited."
31+
field :createdAt, !types.String,
32+
"The ISO 8601 date format of the time that this resource was created.", property: :created_at
33+
34+
field :updatedAt, !types.String, "The ISO 8601 date format of the time that this resource was edited.",
35+
property: :updated_at
3336
end
3437
end
3538
end

app/models/graph/types/starship.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ module Types
5353
field :consumables, types.String, "The maximum length of time that this starship can provide consumables for its entire crew without having to resupply."
5454
connection :pilots, Graph::Types::Person.connection_type
5555

56-
field :created_at, !types.String, "The ISO 8601 date format of the time that this resource was created."
57-
field :updated_at, !types.String, "The ISO 8601 date format of the time that this resource was updated."
56+
field :createdAt, !types.String,
57+
"The ISO 8601 date format of the time that this resource was created.", property: :created_at
58+
59+
field :updatedAt, !types.String,
60+
"The ISO 8601 date format of the time that this resource was updated.", property: :updated_at
5861
end
5962
end
6063
end

app/models/graph/types/user.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ module Types
66

77
field :name, !types.String
88
field :username, !types.String
9-
field :createdAt, !types.String, "The ISO 8601 date format of the time that this resource was created."
10-
field :updatedAt, !types.String, "The ISO 8601 date format of the time that this resource was updated."
9+
field :createdAt, !types.String,
10+
"The ISO 8601 date format of the time that this resource was created.", property: :created_at
11+
field :updatedAt, !types.String,
12+
"The ISO 8601 date format of the time that this resource was updated.", property: :updated_at
1113
end
1214
end
1315
end

app/models/graph/types/vehicle.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ module Types
3939
field :consumables, types.String, "The maximum length of time that this vehicle can provide consumables for its entire crew without having to resupply."
4040
connection :pilots, Graph::Types::Person.connection_type
4141

42-
field :created_at, !types.String, "The ISO 8601 date format of the time that this resource was created."
43-
field :updated_at, !types.String, "The ISO 8601 date format of the time that this resource was updated."
42+
field :createdAt, !types.String,
43+
"The ISO 8601 date format of the time that this resource was created.", property: :created_at
44+
45+
field :updatedAt, !types.String,
46+
"The ISO 8601 date format of the time that this resource was updated.", property: :updated_at
4447
end
4548
end
4649
end

test/controllers/graphql_controller_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class GraphQLControllerTest < ActionDispatch::IntegrationTest
5959
"cargoCapacity" => 100000.0,
6060
"consumables" => "2 months",
6161
"costInCredits" => 100000.0,
62-
"created_at" => "2014-12-10 16:59:45 UTC",
62+
"createdAt" => "2014-12-10 16:59:45 UTC",
6363
"crew" => "4",
6464
"hyperdriveRating" => 0.5,
6565
"length" => 34.37,
@@ -75,7 +75,7 @@ class GraphQLControllerTest < ActionDispatch::IntegrationTest
7575
"cargoCapacity" => 10.0,
7676
"consumables" => "none",
7777
"costInCredits" => nil,
78-
"created_at" => "2014-12-15 12:22:12 UTC",
78+
"createdAt" => "2014-12-15 12:22:12 UTC",
7979
"crew" => "2",
8080
"length" => 4.5,
8181
"manufacturer" => "Incom corporation",
@@ -211,7 +211,7 @@ def full_graphql_query
211211
cargoCapacity
212212
consumables
213213
costInCredits
214-
created_at
214+
createdAt
215215
crew
216216
hyperdriveRating
217217
length
@@ -227,7 +227,7 @@ def full_graphql_query
227227
cargoCapacity
228228
consumables
229229
costInCredits
230-
created_at
230+
createdAt
231231
crew
232232
length
233233
manufacturer

0 commit comments

Comments
 (0)