cancel
Showing results for 
Search instead for 
Did you mean: 

Flutter+Neo4j

areenadam2
Node

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

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

john3haris
Node Clone

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.

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,
    );
  }

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..

I have responded to your question on the other thread. Link here for future visitors.

areenadam2
Node
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(),
    ),
  ),
);
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.