Skip to content

Commit

Permalink
feat(graphql): Set max execution depth to 10 (#1431)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->
We have the possibility for "infinite" recursion in our parties query
(sub-parties)

```
  parties {
    subParties {
      subParties {
        subParties {
          subParties {
            ...
          }
        }
      }
    }
  }
```
Capping the global query depth level at 10. 
(Max depth on dialogById seems to be 7) 

```
query q {
  dialogById(dialogId: "c8147d41-936e-4124-8119-ea1add40c4b4") {
    dialog {
      transmissions {
        content {
          title {
            mediaType
            value {
              value
            }
          }
        }
      }
    }
  }
}
```

## Related Issue(s)

- #1430
  • Loading branch information
oskogstad authored Nov 11, 2024
1 parent 6a9cd69 commit 8845e49
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static IServiceCollection AddDialogportenGraphQl(this IServiceCollection
.AddType<SearchDialogValidationError>()
.AddType<SearchDialogForbidden>()
.AddType<SetSystemLabelEntityNotFound>()
.AddMaxExecutionDepthRule(10)
.AddInstrumentation()
.InitializeOnStartup()
.Services;
Expand Down

0 comments on commit 8845e49

Please sign in to comment.