# Graphql\_flutter Failed to connect to local database

**URL:** <https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303>\
**Category:** GraphQL & GRANDstack\
**Created:** [May 7, 2020, 6:34pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303 "2020-05-07T18:34:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![louis.deveseleer](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/louis.deveseleer/32/10708_2.png) [@louis.deveseleer](https://community.neo4j.com/u/louis.deveseleer)\
**Post date:** [May 7, 2020, 6:34pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/1 "2020-05-07T18:34:41Z")

</div>

Hey everyone, I am trying to build a Flutter app that will use Neo4j as database.  
I am new to programming and new to Neo4j.  
The plugin [graphql\_flutter](https://pub.dev/packages/graphql_flutter) should allow me to communicate with the database through using GraphQL.  
I created a test app that fetches data from a freely available database and that works, so the code should be good. Here is the code : [graphql\_app/main.dart at master · louisdeveseleer/graphql\_app · GitHub](https://github.com/louisdeveseleer/graphql_app/blob/master/main.dart)

Here are the steps I followed on the Neo4j side:  
-Create a local database on Neo4j desktop  
-Install the GraphQL plugin  
-Remove authentication for this database (to make things easier to start with) with the setting `dbms.security.auth_enabled=false`  
-Populate this database with the sample movie data `:play movie`  
-Automatically generate the graphql schema (`CALL graphql.idl(null);`)  
-Launch GraphiQL and connect to [http://localhost:7474/graphql/](http://localhost:7474/graphql/)  
-Test a query:

```auto
{Movie{
        title
      }
}

```

which returned a list of movies, so everything seems to be set up right.

Here is the issue:  
When in the Flutter app I replace the line for the HttpLink  
`uri: 'https://countries.trevorblades.com/'` (used for testing)  
by  
`uri: 'http://localhost:7474/graphql/'`  
then i get this error on the app screen:  
**`ClientException: Failed to connect to http://localhost:7474/graphql/:`**

And since it is working with GraphiQL, I don't know what to do here.

---

<div class="post-metadata">

**Author:** ![jhonathanmarolo](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jhonathanmarolo/32/171_2.png) [@jhonathanmarolo](https://community.neo4j.com/u/jhonathanmarolo)\
**Post date:** [May 8, 2020, 6:26pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/2 "2020-05-08T18:26:23Z")

</div>

Hi Louis,  
Some questions:

• Which version of neo4j are you using?  
• Were you able to connect at some point with some other code?  
• Did you test the connection directly via neo4j desktop | browser?

---

<div class="post-metadata">

**Author:** ![louis.deveseleer](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/louis.deveseleer/32/10708_2.png) [@louis.deveseleer](https://community.neo4j.com/u/louis.deveseleer)\
**Post date:** [May 8, 2020, 6:31pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/3 "2020-05-08T18:31:41Z")

</div>

Hi!

- Neo4j 4.0.1
- It's the first time I am trying to connect to my local database with a code
- I can access the database by going into a browser and typing [http://localhost:7474/browser/](http://localhost:7474/browser/) (or through the desktop)

---

<div class="post-metadata">

**Author:** ![jhonathanmarolo](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jhonathanmarolo/32/171_2.png) [@jhonathanmarolo](https://community.neo4j.com/u/jhonathanmarolo)\
**Post date:** [May 8, 2020, 6:36pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/4 "2020-05-08T18:36:39Z")

</div>

I never used the flutter connection, but have you tried the bolt connection?

---

<div class="post-metadata">

**Author:** ![louis.deveseleer](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/louis.deveseleer/32/10708_2.png) [@louis.deveseleer](https://community.neo4j.com/u/louis.deveseleer)\
**Post date:** [May 8, 2020, 6:42pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/5 "2020-05-08T18:42:01Z")

</div>

How can I do that?  
Typing bolt://localhost:7687 in the browser does not work.

---

<div class="post-metadata">

**Author:** ![louis.deveseleer](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/louis.deveseleer/32/10708_2.png) [@louis.deveseleer](https://community.neo4j.com/u/louis.deveseleer)\
**Post date:** [May 8, 2020, 11:58pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/6 "2020-05-08T23:58:08Z")

</div>

I am now trying Google cloud platform to host and access my database through GraphQL. The hosting of the database is up and running but I struggle to find exactly how to install a graphql plugin on it.

---

<div class="post-metadata">

**Author:** ![elibailey97](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/elibailey97/32/4410_2.png) [@elibailey97](https://community.neo4j.com/u/elibailey97)\
**Post date:** [June 5, 2020, 11:21pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/7 "2020-06-05T23:21:32Z")

</div>

Were you able to figure anything out? I'm about to try Flutter - Neo4j too

---

<div class="post-metadata">

**Author:** ![louis.deveseleer](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/louis.deveseleer/32/10708_2.png) [@louis.deveseleer](https://community.neo4j.com/u/louis.deveseleer)\
**Post date:** [June 7, 2020, 3:31pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/8 "2020-06-07T15:31:58Z")

</div>

No. I switched to Firebase and everything is much easier to setup and manage. I still like the idea of a graph database, but the implementation is just too technically difficult to be worth it in my case.

---

<div class="post-metadata">

**Author:** ![louis.deveseleer](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/louis.deveseleer/32/10708_2.png) [@louis.deveseleer](https://community.neo4j.com/u/louis.deveseleer)\
**Post date:** [July 3, 2020, 2:41pm UTC](https://community.neo4j.com/t/graphql-flutter-failed-to-connect-to-local-database/18303/9 "2020-07-03T14:41:18Z")

</div>

Here is a solution to try : [Neo4j user trying to implement it with GraphQl and use it in a Flutter app - #7 by john3haris](https://community.neo4j.com/t/neo4j-user-trying-to-implement-it-with-graphql-and-use-it-in-a-flutter-app/16883/7)
