Last active
January 19, 2018 09:08
-
-
Save darkodemic/509e29ddac1388fcd47c2002fda9680d to your computer and use it in GitHub Desktop.
Go and GraphQL - Schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/graphql-go/graphql-go-handler" | |
"github.com/graphql-go/graphql" | |
"net/http" | |
) | |
var queryType = graphql.NewObject(graphql.ObjectConfig{ | |
Name: "Query", | |
Fields: graphql.Fields{ | |
"fieldName": &graphql.Field{ | |
Type: graphql.String, | |
Resolve: func(p graphql.ResolveParams) (interface{}, error) { | |
return "Hi there!", nil | |
}, | |
}, | |
}, | |
}) | |
var Schema, _ = graphql.NewSchema(graphql.SchemaConfig{ | |
Query: queryType, | |
}) | |
func main() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment