Skip to content

Commit

Permalink
Add support for MULT field (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
therealemjy authored Jun 25, 2023
1 parent 06c665f commit 2937d24
Show file tree
Hide file tree
Showing 41 changed files with 2,551 additions and 1,397 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-planes-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eth-graphql": minor
---

Add support for MULT field
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Tests and Checks

on: [push]
on: [pull_request]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
typecheck:
Expand All @@ -12,7 +16,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'

- name: Install dependencies
Expand All @@ -30,7 +34,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'

- name: Install dependencies
Expand All @@ -48,7 +52,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'

- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/contracts/TestContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ contract TestContract {
return 'string example';
}

function getNamedString() public view returns (string memory movieTitle) {
return movies[0].title;
function getNamedString() public pure returns (string memory movieTitle) {
return 'named string example';
}

function getBoolean() public pure returns (bool) {
Expand Down
222 changes: 222 additions & 0 deletions packages/e2e-tests/test/finalBossCallFragment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
export const FINAL_BOSS_CALL_FRAGMENT = /* GraphQL */ `
getAnyMovie {
id
title
status
}
movies(arg0: 0) {
id
title
status
director {
name
walletAddress
}
}
getAllMovies {
id
title
status
director {
name
walletAddress
}
}
getMultipleValues {
value0
value1
value2 {
name
walletAddress
}
}
getNothing
getString
getNamedString
getBoolean
getAddress
getBytes
getUint
getInt
getTuple
overloadedFn0(arg0: 10) {
value0
value1
}
overloadedFn1 {
value0
value1
}
overloadedFn2(arg0: "some-string", arg1: "10000000000000000000", arg2: "") {
value0
value1
}
passUnnamedString(arg0: "some-string")
passString(someString: "some-string")
passBoolean(someBoolean: true)
passAddress(someAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111")
passBytes(
someBytes: "0xed6c11b0b5b808960df26f5bfc471d04c1995b0ffd2055925ad1be28d6baadfd"
)
passUint(someUint: "128738121231267831231323")
passInt(someInt: 1265341)
passTuple(someTuple: ["0", "1", "2"])
passMovie(
someMovie: {
id: "0"
title: "fake movie"
status: "1"
director: {
name: "fake director"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
}
) {
id
title
status
director {
name
walletAddress
}
}
mayhem(
arg0: "fake string"
someUint: 671432189
arg2: ["1000000000000000000", "200000000000000000"]
someMovies: [
{
id: "0"
title: "fake movie"
status: "1"
director: {
name: "fake director"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
}
{
id: "0"
title: "fake movie"
status: "1"
director: {
name: "fake director"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
}
]
someDirectors: [
{
name: "fake director"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
{
name: "fake director"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
]
someStatuses: [0, 1, 1, 1]
) {
passedMovies {
id
title
status
director {
name
walletAddress
}
}
value1
statuses
director {
name
walletAddress
}
}
mayhem_MULT(args: [{
arg0: "fake string 0"
someUint: 671432189
arg2: ["1000000000000000000", "200000000000000000"]
someMovies: [
{
id: "0"
title: "fake movie 0"
status: "0"
director: {
name: "fake director"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
}
{
id: "1"
title: "fake movie 1"
status: "1"
director: {
name: "fake director"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
}
]
someDirectors: [
{
name: "fake director 0"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
{
name: "fake director 1"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
]
someStatuses: [0, 1, 1, 1]
}, {
arg0: "fake string 1"
someUint: 671432189
arg2: ["3000000000000000000", "400000000000000000"]
someMovies: [
{
id: "2"
title: "fake movie 2"
status: "1"
director: {
name: "fake director 1"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
}
{
id: "3"
title: "fake movie 3"
status: "0"
director: {
name: "fake director 1"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
}
]
someDirectors: [
{
name: "fake director 2"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
{
name: "fake director 3"
walletAddress: "0xA5ae0b2386De51Aba852551A1EE828BfD598E111"
}
]
someStatuses: [1, 0, 1, 0]
}]) {
passedMovies {
id
title
status
director {
name
walletAddress
}
}
value1
statuses
director {
name
walletAddress
}
}
`;
Loading

0 comments on commit 2937d24

Please sign in to comment.