MCPcopy
hub / github.com/dgraph-io/dgraph / add

Method add

graphql/bench/auth_test.go:482–496  ·  view source on GitHub ↗
(b *testing.B, metaInfo *testutil.AuthMeta)

Source from the content-addressed store, hash-verified

480type Owners []Owner
481
482func (o Owners) add(b *testing.B, metaInfo *testutil.AuthMeta) {
483 getParams := &common.GraphQLParams{
484 Headers: getJWT(b, metaInfo),
485 Query: `
486 mutation addOwner($owners: [AddOwnerInput!]!) {
487 addOwner(input: $owners) {
488 numUids
489 }
490 }
491 `,
492 Variables: map[string]interface{}{"owners": o},
493 }
494 gqlResponse := getParams.ExecuteAsPost(b, graphqlURL)
495 require.Nil(b, gqlResponse.Errors)
496}
497
498func BenchmarkMutation(b *testing.B) {
499 schemaFile := "schema_auth.graphql"

Callers 2

BenchmarkMutationFunction · 0.45

Calls 2

ExecuteAsPostMethod · 0.95
getJWTFunction · 0.85

Tested by

no test coverage detected