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

Upgrade to Graphene 3.1.0 #88

Merged
merged 4 commits into from
May 30, 2022
Merged

Upgrade to Graphene 3.1.0 #88

merged 4 commits into from
May 30, 2022

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