Skip to content

Commit

Permalink
fix broken code caused by graphql-go API updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zhujiaqi committed Feb 2, 2016
1 parent 8c14db3 commit c50f590
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions data/schema.go
Expand Up @@ -74,10 +74,10 @@ func init() {
Type: widgetConnection.ConnectionType,
Description: "A person's collection of widgets",
Args: relay.ConnectionArgs,
Resolve: func(p graphql.ResolveParams) interface{} {
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
args := relay.NewConnectionArguments(p.Args)
dataSlice := WidgetsToInterfaceSlice(GetWidgets()...)
return relay.ConnectionFromArray(dataSlice, args)
return relay.ConnectionFromArray(dataSlice, args), nil
},
},
},
Expand All @@ -98,8 +98,8 @@ func init() {
// Add you own root fields here
"viewer": &graphql.Field{
Type: userType,
Resolve: func(p graphql.ResolveParams) interface{} {
return GetViewer()
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
return GetViewer(), nil
},
},
},
Expand Down Expand Up @@ -127,5 +127,4 @@ func init() {
if err != nil {
panic(err)
}

}
2 changes: 1 addition & 1 deletion scripts/updateSchema.go
Expand Up @@ -12,7 +12,7 @@ import (

func main() {
// Save JSON of full schema introspection for Babel Relay Plugin to use
result := graphql.Graphql(graphql.Params{
result := graphql.Do(graphql.Params{
Schema: data.Schema,
RequestString: testutil.IntrospectionQuery,
})
Expand Down

0 comments on commit c50f590

Please sign in to comment.