Skip to content

Workaround Request: Monday API and DSL Dynamic Queries #380

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

Closed
PhillZitt opened this issue Jan 21, 2023 · 4 comments
Closed

Workaround Request: Monday API and DSL Dynamic Queries #380

PhillZitt opened this issue Jan 21, 2023 · 4 comments
Labels
type: question or discussion Issue discussing or asking a question about gql

Comments

@PhillZitt
Copy link

In reference to #295 , I've come across the same problem where Monday's API is expecting out-of-spec numerics as Int for a mutation. I'm using the DSL to create dynamic queries and the internal validation is throwing the expected error:

Int cannot represent non 32-bit signed integer value: 381719XXXX

Injecting the necessary identifier as an argument directly fails:
mut = DSLMutation(ds.Mutation.create_item.args( board_id=boardId, group_id=groupId, item_name=item.Name, column_values=... ).select(ds.Item.name))

as does injecting as a variable:
var = DSLVariableDefinitions() mut = DSLMutation(ds.Mutation.create_item.args( board_id=var.boardId, group_id=groupId, item_name=item.Name, column_values=... ).select(ds.Item.name))

and attempting the workaround from 295 (not loading the schema) isn't possible from what I understand, and the schema is required to dynamically make queries. I've already opened a bug on their end, but I'm hoping for a workaround for the dynamic queries in the meantime.

@leszekhanusz
Copy link
Collaborator

Could you please download the schema and attach it here so that I could have a look at it?

@leszekhanusz leszekhanusz added the type: question or discussion Issue discussing or asking a question about gql label Jan 21, 2023
@PhillZitt
Copy link
Author

The two relevant sections are:

  """Create a new item."""
  create_item(
    """The new item's name."""
    item_name: String

    """The board's unique identifier."""
    board_id: Int!

    """The group's unique identifier."""
    group_id: String

    """The column values of the new item."""
    column_values: JSON

    """
    Create Status/Dropdown labels if they're missing. (Requires permission to change board structure)
    """
    create_labels_if_missing: Boolean
  ): Item

and

"""A monday.com board."""
type Board {
  """The board log events."""
  activity_logs(
    <...>
  ): [ActivityLogType]

  """The board's folder unique identifier."""
  board_folder_id: Int

  """The board's kind (public / private / share)."""
  board_kind: BoardKind!

  """The board's visible columns."""
  columns(
    """A list of column unique identifiers."""
    ids: [String]
  ): [Column]

  """Get the board communication value - typically meeting ID"""
  communication: JSON

  """The creator of the board."""
  creator: User!

  """The board's description."""
  description: String

  """The board's visible groups."""
  groups(
    """A list of group unique identifiers."""
    ids: [String]
  ): [Group]

  """The unique identifier of the board."""
  id: ID!

  <...>
}

And I've attached MondaySchema.txt as requested.

@leszekhanusz
Copy link
Collaborator

The advantage with Python is that you can modify nearly everything.
It should work if you add this at the beginning of your file:

import sys
import graphql
graphql.type.scalars.GRAPHQL_MAX_INT = sys.maxsize

@PhillZitt
Copy link
Author

I am rather new at Python, I'll try to keep that in mind. I wouldn't have thought I could modify a library's parameter like that. I appreciate your help! That's unstuck me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about gql
Projects
None yet
Development

No branches or pull requests

2 participants