@@ -18,11 +18,11 @@ class Query(R.ObjectType):
18
18
schema = R .Schema (R .Query )
19
19
20
20
pets = {
21
- '5' : Pet (id = '5' , name = 'Garfield' ),
22
- '6' : Pet (id = '6' , name = 'Odis' )
21
+ 5 : Pet (id = 5 , name = 'Garfield' ),
22
+ 6 : Pet (id = 6 , name = 'Odis' )
23
23
}
24
24
25
- data = Query (pets = [pets ['5' ], pets ['6' ]])
25
+ data = Query (pets = [pets [5 ], pets [6 ]])
26
26
result = graphql (schema , '{ pets { id, name } }' , data )
27
27
assert result .data == {'pets' : [{'id' : 'UGV0OjU=' , 'name' : 'Garfield' }, {'id' : 'UGV0OjY=' , 'name' : 'Odis' }]}
28
28
assert not result .errors
@@ -48,11 +48,11 @@ def __init__(self, id, name):
48
48
self .name = name
49
49
50
50
pets = {
51
- '5' : MyPet (id = '5' , name = 'Garfield' ),
52
- '6' : MyPet (id = '6' , name = 'Odis' )
51
+ 5 : MyPet (id = 5 , name = 'Garfield' ),
52
+ 6 : MyPet (id = 6 , name = 'Odis' )
53
53
}
54
54
55
- data = Query (pets = [pets ['5' ], pets ['6' ]])
55
+ data = Query (pets = [pets [5 ], pets [6 ]])
56
56
result = graphql (schema , '{ pets { id, name } }' , data )
57
57
assert result .data == {'pets' : [{'id' : 'UGV0OjU=' , 'name' : 'Garfield' }, {'id' : 'UGV0OjY=' , 'name' : 'Odis' }]}
58
58
assert not result .errors
@@ -73,8 +73,8 @@ class Query(R.ObjectType):
73
73
74
74
schema = R .Schema (R .Query )
75
75
76
- data_source .add (Pet (id = '5' , name = 'Garfield' ))
77
- data_source .add (Pet (id = '6' , name = 'Odis' ))
76
+ data_source .add (Pet (id = 5 , name = 'Garfield' ))
77
+ data_source .add (Pet (id = 6 , name = 'Odis' ))
78
78
79
79
result = graphql (schema , '''
80
80
{
0 commit comments