MCPcopy Create free account
hub / github.com/encoder-run/operator / Exec

Method Exec

pkg/graph/generated.go:787–855  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

785}
786
787func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
788 rc := graphql.GetOperationContext(ctx)
789 ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)}
790 inputUnmarshalMap := graphql.BuildUnmarshalerMap(
791 ec.unmarshalInputAddModelDeploymentInput,
792 ec.unmarshalInputAddModelInput,
793 ec.unmarshalInputAddPipelineDeploymentInput,
794 ec.unmarshalInputAddPipelineInput,
795 ec.unmarshalInputAddRepositoryEmbeddingsInput,
796 ec.unmarshalInputAddRepositoryInput,
797 ec.unmarshalInputAddStorageDeploymentInput,
798 ec.unmarshalInputAddStorageInput,
799 ec.unmarshalInputHuggingFaceInput,
800 ec.unmarshalInputPostgresInput,
801 ec.unmarshalInputQueryInput,
802 )
803 first := true
804
805 switch rc.Operation.Operation {
806 case ast.Query:
807 return func(ctx context.Context) *graphql.Response {
808 var response graphql.Response
809 var data graphql.Marshaler
810 if first {
811 first = false
812 ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
813 data = ec._Query(ctx, rc.Operation.SelectionSet)
814 } else {
815 if atomic.LoadInt32(&ec.pendingDeferred) > 0 {
816 result := <-ec.deferredResults
817 atomic.AddInt32(&ec.pendingDeferred, -1)
818 data = result.Result
819 response.Path = result.Path
820 response.Label = result.Label
821 response.Errors = result.Errors
822 } else {
823 return nil
824 }
825 }
826 var buf bytes.Buffer
827 data.MarshalGQL(&buf)
828 response.Data = buf.Bytes()
829 if atomic.LoadInt32(&ec.deferred) > 0 {
830 hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0
831 response.HasNext = &hasNext
832 }
833
834 return &response
835 }
836 case ast.Mutation:
837 return func(ctx context.Context) *graphql.Response {
838 if !first {
839 return nil
840 }
841 first = false
842 ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
843 data := ec._Mutation(ctx, rc.Operation.SelectionSet)
844 var buf bytes.Buffer

Callers 1

GetPostgresClientFunction · 0.80

Calls 3

_QueryMethod · 0.95
_MutationMethod · 0.95
MarshalGQLMethod · 0.45

Tested by

no test coverage detected