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