File tree 2 files changed +18
-4
lines changed
2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ var PingField = &graphql.Field{
19
19
20
20
var CurrentUserField = & graphql.Field {
21
21
Name : "CurrentUser" ,
22
- Type : types .UserType ,
22
+ Type : types .CurrentUserType ,
23
23
Resolve : func (p graphql.ResolveParams ) (interface {}, error ) {
24
24
srvs , err := servicesFromResolveParams (p )
25
25
if err != nil {
@@ -43,7 +43,7 @@ var CurrentUserField = &graphql.Field{
43
43
}
44
44
45
45
var AuthUserField = & graphql.Field {
46
- Type : types .UserType ,
46
+ Type : types .CurrentUserType ,
47
47
Description : "Authenticates and authorizes an user." ,
48
48
Args : graphql.FieldConfigArgument {
49
49
"username" : & graphql.ArgumentConfig {
Original file line number Diff line number Diff line change 4
4
"github.com/graphql-go/graphql"
5
5
)
6
6
7
- var UserType = graphql .NewObject (graphql.ObjectConfig {
8
- Name : "UserType " ,
7
+ var CurrentUserType = graphql .NewObject (graphql.ObjectConfig {
8
+ Name : "CurrentUserType " ,
9
9
Fields : graphql.Fields {
10
10
"id" : & graphql.Field {
11
11
Description : "The id of the user." ,
@@ -21,3 +21,17 @@ var UserType = graphql.NewObject(graphql.ObjectConfig{
21
21
},
22
22
},
23
23
})
24
+
25
+ var UserType = graphql .NewObject (graphql.ObjectConfig {
26
+ Name : "UserType" ,
27
+ Fields : graphql.Fields {
28
+ "id" : & graphql.Field {
29
+ Description : "The id of the user." ,
30
+ Type : graphql .String ,
31
+ },
32
+ "username" : & graphql.Field {
33
+ Description : "The username of the user." ,
34
+ Type : graphql .String ,
35
+ },
36
+ },
37
+ })
You can’t perform that action at this time.
0 commit comments