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

Query filter not working #6

Open
whittlem opened this issue Apr 16, 2022 · 0 comments
Open

Query filter not working #6

whittlem opened this issue Apr 16, 2022 · 0 comments

Comments

@whittlem
Copy link

Your library is working well for me, except I can't filter my queries. It returns always returns all records.

I have 100 records that look similar to this.

0:
address: "0x007c7390144f480c7a83e4a8f29c0bc01ed13a2d"
id: "0x007c7390144f480c7a83e4a8f29c0bc01ed13a2d"
token: {__typename: 'ERC20', id: '0x37fd5028eeca243571773d15bd4fe0be24e2c1d2', name: 'Michael Whittle', symbol: 'WHITTLE', decimals: 18}
__typename: "ERC20BalanceTier"

This query returns all records as expected.

const GET_TIER_ADDRESS = gql`
	query {
	  tierContracts {
	    id
	    address
	    __typename
	    ... on ERC20BalanceTier {
	      token {
	        id
	        name
	        symbol
	        decimals
	      }
	    }
	    ... on CombineTier {
	      state {
	        constants
	      }
	    }
	  }
	}
`;

const tierAddress = gqlclient.query(GET_TIER_ADDRESS);

This query should filter for the first record but always returns all 100.

const GET_TIER_ADDRESS = gql`
query ($tierAddress: Bytes!) {
  tierContracts (address: $tierAddress) {
    id
    address
    __typename
    ... on ERC20BalanceTier {
      token {
        id
        name
        symbol
        decimals
      }
    }
    ... on CombineTier {
      state {
        constants
      }
    }
  }
}
`;

const tierAddress = gqlclient.query(GET_TIER_ADDRESS, { variables: { tierAddress: "0x007c7390144f480c7a83e4a8f29c0bc01ed13a2d" } });

Is there a problem with my query or is this is a bug?

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

No branches or pull requests

1 participant