View wrap_graphql.go
package resolver | |
import ( | |
"reflect" | |
"strings" | |
"github.com/graphql-go/graphql" | |
"github.com/mitchellh/mapstructure" | |
"gopkg.in/asaskevich/govalidator.v4" | |
) |
View login.ts
export interface AuthTokenResponse { | |
token?: string; | |
created?: boolean; | |
user?: UserType; | |
errors?: ValidationError[]; | |
} | |
// tslint:disable:no-multiline-string | |
const LOGIN_MUTATION = gql` |
View fail.json
{ | |
"version": "1.0", | |
"sessionAttributes": { | |
"Counter": 1, | |
"QuizAnswer": "Jefferson City", | |
"QuizItemIndex": 24, | |
"QuizProperty": "Capital", | |
"QuizScore": 0, | |
"State": 1 | |
}, |
View simple_example.go
func init() { | |
mutationConfig.AddFieldConfig("sentimentAnalysis", &graphql.Field{ | |
Type: graphql.NewObject(graphql.ObjectConfig{ | |
Name: "SentimentAnalysisResult", | |
Description: "Sentiment Analysis Response", | |
Fields: graphql.Fields{ | |
"score": &graphql.Field{ | |
Type: graphql.Int, | |
}, | |
}, |
View user_update.go
package nresolver | |
import ( | |
"context" | |
"github.com/graphql-go/graphql" | |
"github.com/koblas/projectx/server-go/pkg/contextkey" | |
"github.com/koblas/projectx/server-go/pkg/model" | |
"github.com/koblas/projectx/server-go/pkg/service" | |
) |
View schema.go
package nresolver | |
import ( | |
"github.com/graphql-go/graphql" | |
) | |
var queryConfig = graphql.NewObject(graphql.ObjectConfig{ | |
Name: "Query", | |
// Must initialize to an empty set | |
Fields: graphql.Fields{}, |
View wrap_isauth.go
package nresolver | |
import ( | |
"errors" | |
"github.com/graphql-go/graphql" | |
"github.com/koblas/projectx/server-go/pkg/contextkey" | |
"github.com/koblas/projectx/server-go/pkg/service" | |
) |
View wrap_graphql.go
package nresolver | |
import ( | |
"reflect" | |
"strings" | |
"github.com/asaskevich/govalidator" | |
"github.com/graphql-go/graphql" | |
"github.com/mitchellh/mapstructure" | |
) |
View user_service.go
// UpdateUser save user updates to the DB | |
func (svc *userService) UpdateUser(ctx context.Context, user *model.User, args UpdateUserInput) (*model.User, error) { | |
update := make(map[string]interface{}) | |
if args.Password != nil { | |
user.HashPassword(*args.Password) | |
update["password"] = user.Password | |
} | |
if args.Name != nil && *args.Name != user.Name { | |
update["name"] = *args.Name |
View openvpn.cf
{ | |
"Description": "EC2 OpenVPN host for stage-railz", | |
"Mappings": { | |
"AmiMap": { | |
"us-east-1": { | |
"bastion": "ami-2757f631", | |
"ecs": "ami-b2df2ca4", | |
"ubuntu1604": "ami-2757f631" | |
}, | |
"us-west-2": { |
NewerOlder