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

GraphQL Mock Query Argument Handling #942

Closed
wants to merge 5 commits into from

Conversation

mtgraham
Copy link
Contributor

@mtgraham mtgraham commented Aug 6, 2020

Description

The elide fact mock is pretty bare bones and can't alter the results based on filters, sorts, or limits in the request.

Proposed Changes

  • Parse the GraphQL query for filters, sorts, and limits
  • Generate values of the response based on all parts of the request

Screenshots

License

I confirm that this contribution is made under an MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.


export default class ElideFactsSerializer extends EmberObject implements NaviFactSerializer {
normalize(payload: AsyncQueryResponse, request: RequestV1): ResponseV1 | undefined {
const requestTable: string = request.logicalTable.table;
normalize(payload: AsyncQueryResponse, request: RequestV1 | RequestV2): ResponseV1 | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just assume v2 from now on?

Copy link
Member

Choose a reason for hiding this comment

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

This is merging onto master not request-v2

@@ -1,11 +1,25 @@
// TODO: Replace any with type supplied by new version of mirage
import { grains } from './graphql';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rebase on this with the new file name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new file names are in the request v2 branch and this is being merged into master

Copy link
Contributor

@jkusa jkusa left a comment

Choose a reason for hiding this comment

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

👍 Ultimately, we will need this in v2. If we merge to master, we will need to rebase v2 on master sooner than later.

@mtgraham
Copy link
Contributor Author

Moving to a PR to merge into request-v2 instead

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.

3 participants