-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: using setQuery util in tests that need it #1322
feat: using setQuery util in tests that need it #1322
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gj!
Aside from replacing the mutations in the module.ts
of the modules you also have to check the types. The mutations type of the modules should extend of QueryMutations
instead of defining the setQuery
type. Check the History Queries module to see an example.
|
||
/** | ||
* SemanticQueries store state. | ||
* | ||
* @public | ||
*/ | ||
export interface SemanticQueriesState { | ||
export interface SemanticQueriesState extends QueryState { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from extending QueryState
you have to remove the query
type definition in the state. QueryState
already has the query
type definition in it, so you're basically duplicating the type definition.
There are several modules that do this wrong so remember to fix those too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @albertjcuac, @CachedaCodes : I think this should be also done for mutations if we are extending QueryMutations
: is that right?
Example below:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's true
|
||
/** | ||
* SemanticQueries store state. | ||
* | ||
* @public | ||
*/ | ||
export interface SemanticQueriesState { | ||
export interface SemanticQueriesState extends QueryState { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's true
import { SemanticQueriesXStoreModule } from './types'; | ||
import { fetchSemanticQuery } from './actions/fetch-semantic-query.action'; | ||
import { fetchAndSaveSemanticQuery } from './actions/fetch-and-save-semantic-query.action'; | ||
import { request } from './getters/request.getter'; | ||
import { normalizedQuery } from './getters/normalized-query.getter'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here should be a linebreak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gj!
I have been searching and I think it is all done!
Pull request template
Motivation and context
This task is to check in the different modules that all mutations of a query are taking advantage of the setQuery util functionality and import the setQuery & use it if necessary. I noticed that in some tests we weren't using the setQuery function
Type of change
What is the destination branch of this PR?
Main