2

I am using Ariadne with Flask.

When I try from ariadne import QueryType, graphql_sync, make_executable_schema as indicated in the Ariadne's doc for Flask I get the following error :

ImportError: cannot import name 'GraphQLNamedType'

I am using :

  • Python 3.5.1

  • ariadne-0.11.0

  • graphql-core-2.3.2

F Blanchet
  • 1,430
  • 3
  • 21
  • 32

2 Answers2

2

At the moment Ariadne is not compatible with many of the graphql-core, so the version should be between 3.0 and 3.1 for Ariadne to work.

pip install "graphql-core<3.1"

Her is some sources:

https://github.com/mirumee/ariadne/issues/345

https://graphql-core-3.readthedocs.io/en/latest/intro.html#getting-started

mama
  • 2,046
  • 1
  • 7
  • 24
0

Seems the issue came from graphql-core version which need to be >=3.

I was unabled to install the version >=3 so I upgraded Python to 3.8. When installing Ariadne, I get the same version 0.11.0 but now the graphql-core version 3.0.5 and no more the error.

F Blanchet
  • 1,430
  • 3
  • 21
  • 32
  • Do you really not have any errors with graphql-core 3.1.1?, I installed graphql-core 3.1.2 and then I got a new error, Now I have 3.0.5 and no errors. – mama Jul 09 '20 at 09:51
  • Sorry I have the 3.0.5 version I just checked, I edited the answer – F Blanchet Jul 09 '20 at 12:01