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

using args causes error in response #197

Open
atomkirk opened this issue Jan 16, 2024 · 2 comments
Open

using args causes error in response #197

atomkirk opened this issue Jan 16, 2024 · 2 comments

Comments

@atomkirk
Copy link

Describe the bug
When I pass optional arguments, the server gets the right params and returns a valid response, but the library fails to parse it. If i return the exact same response from the srerver with the optional arguments removed, it parses it fine.

To Reproduce
I've got these queries:

  static func upcoming(search: String?) -> Selection.RootQueryType<[Meeting]> {
    Selection.RootQueryType<[Meeting]> {
      try $0.meetings(
        filters: ~InputObjects.MeetingFilters(after: ~Meeting.nowString(), search: ~search),
        sort: ~[
          InputObjects.MeetingSort(
            direction: Enums.SortDirection.asc, field: Enums.MeetingSortOption.startedAt)
        ],
        selection: selection.list
      )
    }
  }

i return this json from the server:

          [
            {
              "id": "int_ref_067dfc66bc9146e0a6a",
              "status": null,
              "started_at": "2013-12-09 18:00:00Z",
              "participants": [],
              "topic": "Lunch",
              "conference_url": null,
              "task_count": 0
            },
            {
              "id": "int_ref_2c8a9d4f4e60491187a",
              "status": null,
              "started_at": "2013-12-11 01:00:00Z",
              "participants": [],
              "topic": "Take down Nativity",
              "conference_url": null,
              "task_count": 0
            }
          ]

if I remove after: ~Meeting.nowString(), it works, parses the two rows and displays in my UI. If I include it and the server returns the exact same thing, it fails to parse it.

It's weird that passing an arg would affect how it parses the response. I dont see why those would be connected, but they must be.

I'm using the latest version, latest xcode, etc.

@atomkirk
Copy link
Author

I would dive in and try to fix myself but I don't know swift well enough. I'd pay a $200 bounty for anyone who can fix quickly.

@shaps80
Copy link
Collaborator

shaps80 commented Jan 16, 2024

I'll take a look tomorrow morning, I'm need to re-read this but its late atm for me, so let me check one this in the morning 👍

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

2 participants