Skip to content

Conversation

abhishekkumams
Copy link
Contributor

@abhishekkumams abhishekkumams commented Jun 6, 2024

Why make this change?

What is this change?

  • This PR contains changes related to CLI.
  • Updated the draft schema to add the new property in the runtime section.
  • A new command is added dab configure, which will allow updates for non-entity based config settings.
  • We have added an optional flag --runtime.graphql.depth-limit, which will be used to specify the depth limit for GraphQL queries and mutation.
  • By Default, No limit is imposed.
  • values supported are only integer values [1, Int32.MaxValue].
    example: dab configure --runtime.graphql.depth-limit 20.

NOTE:

if limit is not already specified, it will add this property to config, else update it.

  • Additionally, users can use -1 to remove limit.
    dab configure --runtime.graphql.depth-limit -1

How was this tested?

  • Unit Tests

Sample Request(s)

initial config

"graphql": {
    "path": "/graphql",
    "enabled": true,
    "allow-introspection": true
}

command: dab configure --runtime.graphql.depth-limit 20

"graphql": {
    "path": "/graphql",
    "enabled": true,
    "allow-introspection": true,
    "depth-limit": 20
}

command: dab configure --runtime.graphql.depth-limit 8

"graphql": {
    "path": "/graphql",
    "enabled": true,
    "allow-introspection": true,
    "depth-limit": 8
}

command: dab configure --runtime.graphql.depth-limit -1

"graphql": {
    "path": "/graphql",
    "enabled": true,
    "allow-introspection": true,
    "depth-limit": -1
}

Special Case:
if value of "depth-limit" is null in the config. it will stay as is, if not updated.

"graphql": {
    "path": "/graphql",
    "enabled": true,
    "allow-introspection": true,
    "depth-limit": null
}

command: dab configure

No change:

"graphql": {
    "path": "/graphql",
    "enabled": true,
    "allow-introspection": true,
    "depth-limit": null
}

@abhishekkumams
Copy link
Contributor Author

/azp run

Copy link
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few nits but once cleaned up, looks good!

abhishekkumams and others added 2 commits June 12, 2024 11:30
Co-authored-by: Sean Leonard <sean.leonard@microsoft.com>
Co-authored-by: Sean Leonard <sean.leonard@microsoft.com>
@abhishekkumams
Copy link
Contributor Author

/azp run

Copy link
Contributor

@aaronburtle aaronburtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick responses.

@abhishekkumams
Copy link
Contributor Author

/azp run

@abhishekkumams abhishekkumams merged commit 4f84cb9 into main Jun 13, 2024
@abhishekkumams abhishekkumams deleted the dev/abhishekkuma/add-update-runtime-command-cli-depth-limit branch June 13, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a new CLI command to update values of the runtime section of the config
3 participants