This repository was archived by the owner on Jan 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ function identity(value) {
57
57
}
58
58
59
59
function parseLiteral ( ast ) {
60
+ var boundParseLiteral = parseLiteral . bind ( this ) ;
60
61
var Kind = this . graphql . Kind ;
61
62
62
63
switch ( ast . kind ) {
@@ -71,7 +72,7 @@ function parseLiteral(ast) {
71
72
var _ret = function ( ) {
72
73
var value = Object . create ( null ) ;
73
74
ast . fields . forEach ( function ( field ) {
74
- value [ field . name . value ] = parseLiteral ( field . value ) ;
75
+ value [ field . name . value ] = boundParseLiteral ( field . value ) ;
75
76
} ) ;
76
77
return {
77
78
v : value
@@ -81,7 +82,7 @@ function parseLiteral(ast) {
81
82
if ( ( typeof _ret === 'undefined' ? 'undefined' : _typeof ( _ret ) ) === "object" ) return _ret . v ;
82
83
}
83
84
case Kind . LIST :
84
- return ast . values . map ( parseLiteral ) ;
85
+ return ast . values . map ( boundParseLiteral ) ;
85
86
default :
86
87
return null ;
87
88
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " graphql-factory-types" ,
3
- "version" : " 0.1.0 " ,
3
+ "version" : " 0.1.1 " ,
4
4
"description" : " Custom types plugin for graphql-factory" ,
5
5
"license" : " MIT" ,
6
6
"main" : " index.js" ,
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ function identity(value) {
7
7
}
8
8
9
9
function parseLiteral ( ast ) {
10
+ let boundParseLiteral = parseLiteral . bind ( this )
10
11
let { Kind } = this . graphql
11
12
switch ( ast . kind ) {
12
13
case Kind . STRING :
@@ -18,12 +19,12 @@ function parseLiteral (ast) {
18
19
case Kind . OBJECT : {
19
20
const value = Object . create ( null )
20
21
ast . fields . forEach ( field => {
21
- value [ field . name . value ] = parseLiteral ( field . value )
22
+ value [ field . name . value ] = boundParseLiteral ( field . value )
22
23
} )
23
24
return value
24
25
}
25
26
case Kind . LIST :
26
- return ast . values . map ( parseLiteral )
27
+ return ast . values . map ( boundParseLiteral )
27
28
default :
28
29
return null
29
30
}
You can’t perform that action at this time.
0 commit comments