(ctx context.Context)
| 1785 | } |
| 1786 | |
| 1787 | func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { |
| 1788 | opCtx := graphql.GetOperationContext(ctx) |
| 1789 | ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)} |
| 1790 | inputUnmarshalMap := graphql.BuildUnmarshalerMap( |
| 1791 | ec.unmarshalInputBugAddCommentAndCloseInput, |
| 1792 | ec.unmarshalInputBugAddCommentAndReopenInput, |
| 1793 | ec.unmarshalInputBugAddCommentInput, |
| 1794 | ec.unmarshalInputBugChangeLabelInput, |
| 1795 | ec.unmarshalInputBugCreateInput, |
| 1796 | ec.unmarshalInputBugEditCommentInput, |
| 1797 | ec.unmarshalInputBugSetTitleInput, |
| 1798 | ec.unmarshalInputBugStatusCloseInput, |
| 1799 | ec.unmarshalInputBugStatusOpenInput, |
| 1800 | ) |
| 1801 | first := true |
| 1802 | |
| 1803 | switch opCtx.Operation.Operation { |
| 1804 | case ast.Query: |
| 1805 | return func(ctx context.Context) *graphql.Response { |
| 1806 | var response graphql.Response |
| 1807 | var data graphql.Marshaler |
| 1808 | if first { |
| 1809 | first = false |
| 1810 | ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) |
| 1811 | data = ec._Query(ctx, opCtx.Operation.SelectionSet) |
| 1812 | } else { |
| 1813 | if atomic.LoadInt32(&ec.pendingDeferred) > 0 { |
| 1814 | result := <-ec.deferredResults |
| 1815 | atomic.AddInt32(&ec.pendingDeferred, -1) |
| 1816 | data = result.Result |
| 1817 | response.Path = result.Path |
| 1818 | response.Label = result.Label |
| 1819 | response.Errors = result.Errors |
| 1820 | } else { |
| 1821 | return nil |
| 1822 | } |
| 1823 | } |
| 1824 | var buf bytes.Buffer |
| 1825 | data.MarshalGQL(&buf) |
| 1826 | response.Data = buf.Bytes() |
| 1827 | if atomic.LoadInt32(&ec.deferred) > 0 { |
| 1828 | hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 |
| 1829 | response.HasNext = &hasNext |
| 1830 | } |
| 1831 | |
| 1832 | return &response |
| 1833 | } |
| 1834 | case ast.Mutation: |
| 1835 | return func(ctx context.Context) *graphql.Response { |
| 1836 | if !first { |
| 1837 | return nil |
| 1838 | } |
| 1839 | first = false |
| 1840 | ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) |
| 1841 | data := ec._Mutation(ctx, opCtx.Operation.SelectionSet) |
| 1842 | var buf bytes.Buffer |
| 1843 | data.MarshalGQL(&buf) |
| 1844 |
nothing calls this directly
no test coverage detected