Skip to content

Fixes the bug #1680 that necessitated adding the 'name' parameter to the @model directive, regardless of the name of the GraphQL object type's name.#1714

Merged
neeraj-sharma2592 merged 1 commit intomainfrom
dev/neeraj-sharma2592/fixNameAttributeInvalidExceptionBug1680
Sep 18, 2023
Merged

Fixes the bug #1680 that necessitated adding the 'name' parameter to the @model directive, regardless of the name of the GraphQL object type's name.#1714
neeraj-sharma2592 merged 1 commit intomainfrom
dev/neeraj-sharma2592/fixNameAttributeInvalidExceptionBug1680

Conversation

@neeraj-sharma2592
Copy link
Copy Markdown
Contributor

Why make this change?

   string typeName = GraphQLUtils.TryExtractGraphQLFieldModelName(underlyingType.Directives, out string? modelName) ?
                    modelName :
                    underlyingType.Name;

What is this change?

Checking Directive "name" exists before accessing its value. 

How was this tested?

  • Integration Tests

@neeraj-sharma2592 neeraj-sharma2592 changed the title Fixes the bug #1680 that necessitated adding the 'name' parameter to … Fixes the bug #1680 that necessitated adding the 'name' parameter to the @model directive, regardless of the name of the GraphQL object type's name. Sep 14, 2023
@neeraj-sharma2592 neeraj-sharma2592 enabled auto-merge (squash) September 14, 2023 10:48
Copy link
Copy Markdown
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.

thanks for porting this to main

…the @model directive, regardless of the name of the GraphQL object type's name. (#1706)

## Why make this change?
- Closes #1680 
- Regression introduced in 0.8.49 caused required explicitly adding
"name" directive for all the model/entity irrespective of whether we are
using a different name than the one it originally has.
- Regression introduced in #1402 when we started using
TryExtractGraphQLName as follows:
```
   string typeName = GraphQLUtils.TryExtractGraphQLFieldModelName(underlyingType.Directives, out string? modelName) ?
                    modelName :
                    underlyingType.Name;
```
      
## What is this change?
    Checking Directive "name" exists before accessing its value. 

## How was this tested?
     Tested locally for now. Will be checking Test cases for it.
- [x] Integration Tests
- [ ] Unit Tests

---------

Co-authored-by: Neeraj Sharma <[email protected]>
@neeraj-sharma2592 neeraj-sharma2592 force-pushed the dev/neeraj-sharma2592/fixNameAttributeInvalidExceptionBug1680 branch from 02985cd to eff9b1e Compare September 18, 2023 12:10
@neeraj-sharma2592 neeraj-sharma2592 merged commit e49d72a into main Sep 18, 2023
@neeraj-sharma2592 neeraj-sharma2592 deleted the dev/neeraj-sharma2592/fixNameAttributeInvalidExceptionBug1680 branch September 18, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: swa local run returns always "The argument name is invalid. (Parameter 'argumentName')

3 participants