2018-11-14 10:50:15 +00:00
|
|
|
package satelliteql
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/graphql-go/graphql"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
userType = "user"
|
|
|
|
|
|
|
|
fieldID = "id"
|
|
|
|
fieldEmail = "email"
|
|
|
|
fieldPassword = "password"
|
|
|
|
fieldFirstName = "firstName"
|
|
|
|
fieldLastName = "lastName"
|
2018-11-14 15:13:13 +00:00
|
|
|
fieldCreatedAt = "createdAt"
|
2018-11-14 10:50:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// graphqlUser creates instance of user *graphql.Object
|
|
|
|
func graphqlUser() *graphql.Object {
|
|
|
|
return graphql.NewObject(graphql.ObjectConfig{
|
|
|
|
Name: userType,
|
|
|
|
Fields: graphql.Fields{
|
|
|
|
fieldID: &graphql.Field{
|
|
|
|
Type: graphql.String,
|
|
|
|
},
|
|
|
|
fieldEmail: &graphql.Field{
|
|
|
|
Type: graphql.String,
|
|
|
|
},
|
|
|
|
fieldFirstName: &graphql.Field{
|
|
|
|
Type: graphql.String,
|
|
|
|
},
|
|
|
|
fieldLastName: &graphql.Field{
|
|
|
|
Type: graphql.String,
|
|
|
|
},
|
2018-11-14 15:13:13 +00:00
|
|
|
fieldCreatedAt: &graphql.Field{
|
|
|
|
Type: graphql.DateTime,
|
|
|
|
},
|
2018-11-14 10:50:15 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|