# Flutter+Neo4j

**URL:** <https://community.neo4j.com/t/flutter-neo4j/53195>\
**Category:** GraphQL & GRANDstack\
**Created:** [March 10, 2022, 12:07pm UTC](https://community.neo4j.com/t/flutter-neo4j/53195 "2022-03-10T12:07:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![areenadam2](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/areenadam2/32/21263_2.png) [@areenadam2](https://community.neo4j.com/u/areenadam2)\
**Post date:** [March 10, 2022, 12:07pm UTC](https://community.neo4j.com/t/flutter-neo4j/53195/1 "2022-03-10T12:07:14Z")

</div>

Hi everyone , I wish you are fine ...  
I'm trying to connect my neo4j database with flutter application , after searching here I found that grandstack is the solution .  
So I am using graphql\_flutter but I have some exceptions that I can't fixed it , as shown in the screenshot

 ![Screenshot_٢٠٢٢-٠٣-١٠-١١-٥٤-٥٥-٢٢٥_com.example.graphqltest](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/6/0/608995215232d673a6958cc0e2077dd718d28cfd.jpeg)

- I use Windows 10 OS , with neo4j desktop version  
I use Graphql Architect to connect with Flutter application

---

<div class="post-metadata">

**Author:** ![john3haris](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/john3haris/32/4370_2.png) [@john3haris](https://community.neo4j.com/u/john3haris)\
**Post date:** [March 11, 2022, 10:40pm UTC](https://community.neo4j.com/t/flutter-neo4j/53195/2 "2022-03-11T22:40:49Z")

</div>

Could you please share the `GraphQLClient` code that you're using? Also, is the server working as expected? Did you connect successfully to the playground and return the data as expected?

Here's an example of the `GraphQLClient` code that I'm talking about.

```nohighlight
const clientUri = 'http://ip-adress-here:4001/graphql';

GraphQLClient getClient({String? subscriptionUri, required String tokenId}) {

    Link link = HttpLink(
      clientUri,
      defaultHeaders: {
        'Authorization': '''Bearer $tokenId''',
      },
    );

    if (subscriptionUri != null) {
      final WebSocketLink websocketLink = WebSocketLink(
        subscriptionUri,
        config: const SocketClientConfig(
          autoReconnect: true,
          inactivityTimeout: Duration(seconds: 30),
        ),
      );

      link = link.concat(websocketLink);
    }

    return GraphQLClient(
      cache: cache,
      link: link,
    );
  }

```

---

<div class="post-metadata">

**Author:** ![areenadam2](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/areenadam2/32/21263_2.png) [@areenadam2](https://community.neo4j.com/u/areenadam2)\
**Post date:** [March 12, 2022, 11:24am UTC](https://community.neo4j.com/t/flutter-neo4j/53195/3 "2022-03-12T11:24:49Z")

</div>

```
final HttpLink httpLink = HttpLink(
final ValueNotifier<GraphQLClient> client = ValueNotifier<GraphQLClient>(
  GraphQLClient(
    link: httpLink,
    cache: GraphQLCache(store: HiveStore()),

  ),
);

return GraphQLProvider(
  client: client,
  child: CacheProvider(
    child: MaterialApp(
      title: 'GraphQLTest',
      home: HomePage(),
    ),
  ),
);
```

---

<div class="post-metadata">

**Author:** ![areenadam2](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/areenadam2/32/21263_2.png) [@areenadam2](https://community.neo4j.com/u/areenadam2)\
**Post date:** [March 12, 2022, 11:29am UTC](https://community.neo4j.com/t/flutter-neo4j/53195/4 "2022-03-12T11:29:31Z")

</div>

Yes my server working and I can connected to it from chrome successfully .  
Also GraphQL Architect working good unless I change the default database (neo4j) to my database from editor , here he is still loading forever..

---

<div class="post-metadata">

**Author:** ![john3haris](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/john3haris/32/4370_2.png) [@john3haris](https://community.neo4j.com/u/john3haris)\
**Post date:** [March 12, 2022, 12:53pm UTC](https://community.neo4j.com/t/flutter-neo4j/53195/5 "2022-03-12T12:53:52Z")

</div>

I have responded to your question on the other thread. Link [here](https://community.neo4j.com/t/neo4j-user-trying-to-implement-it-with-graphql-and-use-it-in-a-flutter-app/16883/21) for future visitors.
