MCPcopy Create free account
hub / github.com/dagger/dagger / Server

Struct Server

dagql/server.go:35–91  ·  view source on GitHub ↗

Server represents a GraphQL server whose schema is dynamically modified at runtime.

Source from the content-addressed store, hash-verified

33// Server represents a GraphQL server whose schema is dynamically modified at
34// runtime.
35type Server struct {
36 root AnyObjectResult
37 telemetry AroundFunc
38 objects map[string]ObjectType
39 interfaces map[string]*Interface
40 scalars map[string]ScalarType
41 scalarFilters map[string]ViewFilter
42 typeDefs map[string]TypeDef
43 directives map[string]DirectiveSpec
44
45 schemas map[call.View]*ast.Schema
46 schemaDigests map[call.View]digest.Digest
47 schemaOnces map[call.View]*sync.Once
48 schemaLock *sync.Mutex
49
50 installLock *sync.RWMutex
51 installHooks []InstallHook
52
53 // interfacesDirty is set when an install changes the set of objects or
54 // interfaces, and cleared when interface implementations are reconciled.
55 // Reconciliation is deferred until the type system is next read (see
56 // reconcileInterfaceImplsIfDirty) so a burst of installs reconciles once,
57 // against the complete schema, rather than once per install.
58 interfacesDirty bool
59
60 // View is the default view that is applied to queries on this server.
61 //
62 // WARNING: this is *not* the view of the current query (for that, inspect
63 // the current id)
64 View call.View
65
66 // canonical, if set, is the server without entrypoint sugar.
67 // Entrypoint proxies flatten a module's methods onto the Query root
68 // as syntactic convenience; the canonical server preserves the real
69 // namespace where constructors and core fields live unshadowed.
70 //
71 // Load, LoadType, and callers that need to bypass proxies (proxy
72 // resolvers, SDK plumbing) use Canonical() to reach it.
73 canonical *Server
74
75 // nodeLoader, if set, is called by the node(id:) resolver to load
76 // an object from its ID. This allows the Dagger core layer to
77 // resolve IDs through a server that has all necessary module
78 // dependencies installed, rather than being limited to the
79 // current server's schema.
80 nodeLoader func(ctx context.Context, id *call.ID) (AnyObjectResult, error)
81
82 // resultServerForCall, if set, rebuilds a dependency-aware server from a
83 // result's call graph so the cache can resolve an object class that is not
84 // installed in the current server's schema. Reconstruction normally uses
85 // the class captured on the shared result at construction time
86 // (sharedResult.objClass); this hook is the fallback when capture missed
87 // the path (e.g., persisted-envelope decode, or imports loaded by ID
88 // before any class-bearing wrap). Resolved classes are cached back onto
89 // the shared so subsequent reconstructions skip the hook.
90 resultServerForCall func(ctx context.Context, resultCall *ResultCall) (*Server, error)
91}
92

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected