Skip to content

Commit

Permalink
fix: map type of graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkyao committed Oct 24, 2018
1 parent f8d1541 commit 50ea1e7
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 117 deletions.
1 change: 1 addition & 0 deletions demo/cases.gql
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ type MapType {
mapType4: JSON!
mapType5: JSON!
mapType7: MapType7!
mapType8: JSON!
}

type Parameter {
Expand Down
14 changes: 13 additions & 1 deletion demo/cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,9 @@
},
"mapType7": {
"$ref": "#/definitions/MapType7"
},
"mapType8": {
"$ref": "#/definitions/MapType8"
}
},
"required": [
Expand All @@ -759,7 +762,8 @@
"mapType4",
"mapType5",
"mapType6",
"mapType7"
"mapType7",
"mapType8"
],
"additionalProperties": false
},
Expand All @@ -777,6 +781,14 @@
"type": "string"
}
},
"MapType8": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": {
"type": "string"
}
},
"TaggedField": {
"type": "object",
"properties": {
Expand Down
5 changes: 5 additions & 0 deletions demo/cases.ml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ type mapType7 = {
foo: string;
}

type mapType8 = {

}

type mapType = {
mapType7: mapType7;
mapType8: mapType8;
}

type parameter = {
Expand Down
5 changes: 5 additions & 0 deletions demo/cases.proto
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,16 @@ message MapType7 {
string foo = 1;
}

message MapType8 {

}

message MapType {
map<string, double> mapType = 1;
map<string, TypeLiteral> mapType2 = 2;
map<string, uint32> mapType4 = 4;
MapType7 mapType7 = 7;
MapType8 mapType8 = 8;
}

message Parameter {
Expand Down
6 changes: 6 additions & 0 deletions demo/cases.re
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,15 @@ type mapType7 = {
foo: string,
};

type mapType8 = {
.

};

type mapType = {
.
mapType7: mapType7,
mapType8: mapType8,
};

type parameter = {
Expand Down
6 changes: 6 additions & 0 deletions demo/cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,15 @@ pub struct MapType7 {
pub foo: String,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct MapType8 {

}

#[derive(Serialize, Deserialize, Debug)]
pub struct MapType {
#[serde(rename = "mapType7")] pub map_type_7: MapType7,
#[serde(rename = "mapType8")] pub map_type_8: MapType8,
}

#[derive(Serialize, Deserialize, Debug)]
Expand Down
5 changes: 5 additions & 0 deletions demo/cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ type MapType7 = {
[name: string]: string
}

type MapType8 = {
[name: string]: string
}

type MapType = {
mapType: { [name: string]: number };
mapType2: { [name: string]: TypeLiteral };
Expand All @@ -225,6 +229,7 @@ type MapType = {
[name: string]: number
};
mapType7: MapType7
mapType8: MapType8
}

type ID = any
Expand Down
Loading

0 comments on commit 50ea1e7

Please sign in to comment.