Documentation ¶
Overview ¶
Example ¶
package main import ( "log" "net/http" "github.com/graphql-go/graphql" "github.com/graphql-go/handler" ddgraphql "gopkg.in/DataDog/dd-trace-go.v1/contrib/graphql-go/graphql" ) func main() { schema, err := ddgraphql.NewSchema(graphql.SchemaConfig{ Query: graphql.NewObject(graphql.ObjectConfig{ Name: "Query", Fields: graphql.Fields{ "hello": &graphql.Field{ Name: "hello", Type: graphql.NewNonNull(graphql.String), }, }, }), }) if err != nil { panic(err) } http.Handle("/query", handler.New(&handler.Config{Schema: &schema})) log.Fatal(http.ListenAndServe(":8080", nil)) // then: // $ curl -XPOST -d '{"query": "{ hello }"}' localhost:8080/query }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
func WithAnalytics ¶
WithAnalytics enables Trace Analytics for all started spans.
func WithAnalyticsRate ¶
WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.
func WithServiceName ¶
WithServiceName sets the given service name for the client.
Click to show internal directories.
Click to hide internal directories.