|
9 | 9 | "sync"
|
10 | 10 |
|
11 | 11 | "github.com/nautilus/graphql"
|
12 |
| - "github.com/vektah/gqlparser/ast" |
| 12 | + "github.com/vektah/gqlparser/v2/ast" |
13 | 13 | )
|
14 | 14 |
|
15 | 15 | // Executor is responsible for executing a query plan against the remote
|
@@ -259,8 +259,6 @@ func executeStep(
|
259 | 259 | // we need to find the ids of the objects we are inserting into and then kick of the worker with the right
|
260 | 260 | // insertion point. For lists, insertion points look like: ["user", "friends:0", "catPhotos:0", "owner"]
|
261 | 261 | for _, dependent := range step.Then {
|
262 |
| - log.Debug("Looking for insertion points for ", dependent.InsertionPoint, "\n\n") |
263 |
| - |
264 | 262 | insertPoints, err := executorFindInsertionPoints(resultLock, dependent.InsertionPoint, step.SelectionSet, queryResult, [][]string{insertionPoint}, step.FragmentDefinitions)
|
265 | 263 | if err != nil {
|
266 | 264 | errCh <- err
|
@@ -305,6 +303,7 @@ func findSelection(matchString string, selectionSet ast.SelectionSet, fragmentDe
|
305 | 303 | }
|
306 | 304 | }
|
307 | 305 | }
|
| 306 | + |
308 | 307 | return nil, nil
|
309 | 308 | }
|
310 | 309 |
|
@@ -338,17 +337,17 @@ func executorFindInsertionPoints(resultLock *sync.Mutex, targetPoints []string,
|
338 | 337 | // the point in the steps insertion path that we want to add
|
339 | 338 | point := targetPoints[pointI]
|
340 | 339 |
|
341 |
| - log.Debug("Looking for ", point) |
342 |
| - |
343 |
| - // track wether we found a selection |
| 340 | + // find the selection node in the AST corresponding to the point |
344 | 341 | var foundSelection *ast.Field
|
345 | 342 | foundSelection, err := findSelection(point, selectionSetRoot, fragmentDefs)
|
346 | 343 | if err != nil {
|
| 344 | + log.Debug("Error looking for selection") |
347 | 345 | return [][]string{}, err
|
348 | 346 | }
|
349 | 347 |
|
350 | 348 | // if we didn't find a selection
|
351 | 349 | if foundSelection == nil {
|
| 350 | + log.Debug("No selection") |
352 | 351 | return [][]string{}, nil
|
353 | 352 | }
|
354 | 353 |
|
@@ -377,7 +376,6 @@ func executorFindInsertionPoints(resultLock *sync.Mutex, targetPoints []string,
|
377 | 376 | if !ok {
|
378 | 377 | return nil, fmt.Errorf("Root value of result chunk was not a list: %v", rootValue)
|
379 | 378 | }
|
380 |
| - |
381 | 379 | // build up a new list of insertion points
|
382 | 380 | newInsertionPoints := [][]string{}
|
383 | 381 |
|
|
0 commit comments