Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable or Disable Multiple Create operation based on feature flag value #2116

Conversation

severussundar
Copy link
Contributor

@severussundar severussundar commented Mar 19, 2024

Why make this change?

What is this change?

i) Fields belonging to the related entities are not created in the input object type are not created.
ii) Many type multiple create mutation nodes (ex: createbooks, createpeople_multiple ) are not created.
iii) ReferencingField directive is not applied on relationship fields, so they continue to remain required fields for the create mutation operation.
iv) Entities for linking objects are not created as they are relevant only in the context of multiple create operations.

How was this tested?

  • Unit Tests and Integration Tests
  • Manual Tests

Note: At the moment, multiple create operation is disabled in the config file generated for integration tests. This is because of the plan to merge in the Schema generation, AuthZ/N branches separately to the main branch. With just these 2 PRs, a multiple create operation will fail, hence, the disabling multiple create operation. At the moment, tests that perform validations specific to multiple create feature enable it by i) updating the runtime object (or) ii) creating a custom config in which the operation is enabled.

Sample Request(s)

When Multiple Create operation is enabled - MsSQL

Related entity fields are created in the input object type

image

Multiple type create operation is created in addition to point create operation

image

Querying related entities continue to work successfully

image

When Multiple Create operation is disabled - MsSQL

Only fields belonging to the given entity are created in the input object type

image

Multiple type create operation is not created

When Multiple Create operation is enabled - Other relational database types

Only fields belonging to the given entity are created in the input object type

image

Multiple type create operation is not created

@severussundar severussundar changed the title Enable or Disable Multiple Create operation based depending on feature flag value Enable or Disable Multiple Create operation based on feature flag value Mar 22, 2024
@severussundar
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

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.

pending some suggestions about combining conditionals behind "ismultiplemutationenabled" flag. and nit about test separation. Otherwise looks good and approving so you can get those changes and merge on monday your time.

@severussundar severussundar added the Multiple mutations Fixes/enhancements related to nested mutations. label Mar 23, 2024
@severussundar
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@severussundar
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

src/Config/ObjectModel/RuntimeConfig.cs Outdated Show resolved Hide resolved
src/Config/ObjectModel/RuntimeConfig.cs Outdated Show resolved Hide resolved
src/Core/Services/GraphQLSchemaCreator.cs Outdated Show resolved Hide resolved
src/Service.Tests/Configuration/ConfigurationTests.cs Outdated Show resolved Hide resolved
src/Service.Tests/GraphQLBuilder/MutationBuilderTests.cs Outdated Show resolved Hide resolved
src/Service.Tests/GraphQLBuilder/MutationBuilderTests.cs Outdated Show resolved Hide resolved
@severussundar
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

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.

unclear on check for MultipleCreateSupportingDatabaseType

src/Config/ObjectModel/RuntimeConfig.cs Outdated Show resolved Hide resolved
@severussundar
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@severussundar severussundar merged commit 9a90ca1 into dev/NestedMutations Mar 26, 2024
9 checks passed
@severussundar severussundar deleted the dev/shyamsundarj/honor-multiple-create-feature-flag branch March 26, 2024 09:05
@severussundar severussundar mentioned this pull request Mar 26, 2024
1 task
severussundar added a commit that referenced this pull request Mar 29, 2024
## Why make this change?

- All code changes for **Multiple Create** feature was being merged into
`dev/NestedMutations` branch.
- This PR attempts to merge all these changes to the `main` branch in
preparation for the `0.12.* rc1` release

## What is this change?

- Right now, `dev/NestedMutations` branch contains the code changes for
the following components of Multiple Create feature
- Schema Generation -
#1902
  - AuthZ - #1943
- Feature flag - CLI changes
#1983
- Feature flag - Re-naming changes
#2103
- Feature flag - Engine changes
#2116
- Each specified PR was reviewed before merging into
`dev/NestedMutations` branch.
- This PR aims to merge all the changes into `main` branch
  
## How was this tested?

- [x] Unit, Integration and Manual tests were performed on each PR
before merging into `dev/NestedMutations`

---------

Co-authored-by: Shyam Sundar J <shyamsundarj@microsoft.com>
Co-authored-by: Sean Leonard <sean.leonard@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Multiple mutations Fixes/enhancements related to nested mutations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate engine workflow depending on whether nested mutations are on/off
3 participants