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

Improve validation checks for the topic directive #20

Closed
DawidNiezgodka opened this issue May 13, 2022 · 0 comments · Fixed by #26
Closed

Improve validation checks for the topic directive #20

DawidNiezgodka opened this issue May 13, 2022 · 0 comments · Fixed by #26
Assignees
Labels

Comments

@DawidNiezgodka
Copy link
Contributor

Below, some examples which show invalid behaviour or missing checks.

  1. Validation of keyArguments
type Product {
    id: ID!         
    name: String!   
}

type Query {        
    getProduct(id: ID): Product @topic(name: "product-topic")    
}   

The query is missing the keyArgment but since the mutation rule passes no error will be thrown.
Another example:

type Query {
    getProduct(productId: ID): ProductInfo
}

type ProductInfo {
    product: Product @topic(name: "product-topic")
    url: String @topic(name: "url-topic", keyArgument: "productId")
}
  1. Validation of the rule with one input argument of a mutation type.
type Mutation {
    setClick(clickCount: Long): Long @topic(name: "click-topic")
}  

It should contain 2 inputs.

@DawidNiezgodka DawidNiezgodka added type/bug Something isn't working component/gateway labels May 13, 2022
@DawidNiezgodka DawidNiezgodka self-assigned this May 13, 2022
@DawidNiezgodka DawidNiezgodka added type/enhancement New feature or request and removed type/bug Something isn't working labels May 16, 2022
@torbsto torbsto linked a pull request May 17, 2022 that will close this issue
@torbsto torbsto added this to Quick Aug 1, 2022
@torbsto torbsto moved this to Done in Quick Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant