...
1
2
3 package graph
4
5 import (
6 "context"
7 "errors"
8 "strings"
9
10 "github.com/99designs/gqlgen/plugin/federation/fedruntime"
11 )
12
13 var (
14 ErrUnknownType = errors.New("unknown type")
15 ErrTypeNotFound = errors.New("type not found")
16 )
17
18 func (ec *executionContext) __resolve__service(ctx context.Context) (fedruntime.Service, error) {
19 if ec.DisableIntrospection {
20 return fedruntime.Service{}, errors.New("federated introspection disabled")
21 }
22
23 var sdl []string
24
25 for _, src := range sources {
26 if src.BuiltIn {
27 continue
28 }
29 sdl = append(sdl, src.Input)
30 }
31
32 return fedruntime.Service{
33 SDL: strings.Join(sdl, "\n"),
34 }, nil
35 }
36
View as plain text