Skip to content

Upgrade to Graphene 3.1.0#88

Merged
simonw merged 4 commits intomainfrom
graphene-3-1-0
May 30, 2022
Merged

Upgrade to Graphene 3.1.0#88
simonw merged 4 commits intomainfrom
graphene-3-1-0

Conversation

@simonw
Copy link
Owner

@simonw simonw commented May 30, 2022

I think this is breaking things.

@simonw
Copy link
Owner Author

simonw commented May 30, 2022

datasette_graphql/__init__.py:4: in <module>
    from graphql.error import format_error
E   ImportError: cannot import name 'format_error' from 'graphql.error' (/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/graphql/error/__init__.py)

@simonw
Copy link
Owner Author

simonw commented May 30, 2022

Looks like format_error was deprecated here: graphql-python/graphql-core@09ff14f

@simonw
Copy link
Owner Author

simonw commented May 30, 2022

Found a clue here: https://github.com/graphql-python/graphql-core/blob/7c0d73a24359ac10b5fc46691ba22579f4080ce4/src/graphql/error/graphql_error.py#L259

def format_error(error: GraphQLError) -> GraphQLFormattedError:
    """
    ...
    .. deprecated:: 3.2
       Please use ``error.formatted`` instead. Will be removed in v3.3.
    """
    if not isinstance(error, GraphQLError):
        raise TypeError("Expected a GraphQLError.")
    return error.formatted

@simonw
Copy link
Owner Author

simonw commented May 30, 2022

It was graphql-core that caused the bug, and upgrading to Graphene 3.1.0 doen't force an upgrade of that package, so I'm pinning to at least that version as well.

@simonw simonw merged commit 22cf6a0 into main May 30, 2022
@simonw simonw deleted the graphene-3-1-0 branch May 30, 2022 18:21
simonw added a commit that referenced this pull request May 30, 2022
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.

1 participant