Skip to content

Commit

Permalink
Change map conversion casing
Browse files Browse the repository at this point in the history
  • Loading branch information
aagundez committed Jan 2, 2020
1 parent 658b48b commit 6974018
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ message Attribute {

```graphql
type User {
attributes: [String_Attribute_Map]
attributes: [String_Attribute_map]
}

type String_Attribute_Map {
type String_Attribute_map {
key: String
value: Attribute
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function fullTypeName(type: protobuf.ReflectionObject): string {
const valueType = isScalar(type.type)
? convertScalar(type.type)
: fullTypeName(type.resolvedType);
return `${keyType}_${valueType}_Map`;
return `${keyType}_${valueType}_map`;
}

return type.parent && type.parent.name
Expand Down
4 changes: 2 additions & 2 deletions test/map_fields/output.graphql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
type User {
attributes: [String_Attribute_Map]
attributes: [String_Attribute_map]
}

type String_Attribute_Map {
type String_Attribute_map {
key: String
value: Attribute
}
Expand Down
4 changes: 2 additions & 2 deletions test/well_known_types/output.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ type google_protobuf_FieldMask {
paths: [String]
}
type google_protobuf_Struct {
fields: [String_google_protobuf_Value_Map]
fields: [String_google_protobuf_Value_map]
}
type String_google_protobuf_Value_Map {
type String_google_protobuf_Value_map {
key: String
value: google_protobuf_Value
}
Expand Down

0 comments on commit 6974018

Please sign in to comment.