You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we have a small example on implement mirageJS+graphql for a flutter project which is using graphql-flutter as graphql client.
i have tried your example but facing below issue:
server is running at "http:localhost:3000", i have used your below github example
now, i used the graphql_flutter library in my flutter project and send the request to server, but got below error:
I/flutter (20369):
I/flutter (20369):
I/flutter (20369):
I/flutter (20369):
I/flutter (20369): <title>Error</title>
I/flutter (20369):
I/flutter (20369):
I/flutter (20369):
Cannot POST /graphql
I/flutter (20369):
I/flutter (20369):
//Code i have used in flutter app
..... rest of the code.....
return GraphQLProvider(
client: Client.client,
child: Query(
options: QueryOptions(
documentNode: gql(Queries.placeholderQuery),// string containing query
),
builder: (QueryResult result,
{VoidCallback refetch, FetchMore fetchMore}) {
if (result.hasException) {
return Text(result.exception.toString());
}
if (result.loading) {
return Expanded(
child: Center(child: CircularProgressIndicator()),
);
}
if (result.data == null) {
return Text("No Data Found !");
}
//client url is
class Client {
static ValueNotifier client = ValueNotifier(GraphQLClient(
cache: OptimisticCache(
dataIdFromObject: typenameDataIdFromObject,
),
// used 10.0.2.2 because using android emulator, so 10.0.2.2 is alias for localhost
link: HttpLink(uri: "http://10.0.2.2:3000/graphql")));
}
//query is
static String placeholderQuery = """
query {
movies {
id
title
}
}""";
}
i know i'm doing something wrong, but not able to figure out.Please let me know if you need more information.
The text was updated successfully, but these errors were encountered:
Hi Sam,
Can we have a small example on implement mirageJS+graphql for a flutter project which is using graphql-flutter as graphql client.
i have tried your example but facing below issue:
server is running at "http:localhost:3000", i have used your below github example
now, i used the graphql_flutter library in my flutter project and send the request to server, but got below error:
I/flutter (20369):
I/flutter (20369):
I/flutter (20369):
I/flutter (20369):
I/flutter (20369): <title>Error</title>
I/flutter (20369):
I/flutter (20369):
I/flutter (20369):
I/flutter (20369):
I/flutter (20369):
//Code i have used in flutter app
..... rest of the code.....
return GraphQLProvider(
client: Client.client,
child: Query(
options: QueryOptions(
documentNode: gql(Queries.placeholderQuery),// string containing query
),
builder: (QueryResult result,
{VoidCallback refetch, FetchMore fetchMore}) {
if (result.hasException) {
return Text(result.exception.toString());
}
if (result.loading) {
return Expanded(
child: Center(child: CircularProgressIndicator()),
);
}
if (result.data == null) {
return Text("No Data Found !");
}
//client url is
class Client {
static ValueNotifier client = ValueNotifier(GraphQLClient(
cache: OptimisticCache(
dataIdFromObject: typenameDataIdFromObject,
),
// used 10.0.2.2 because using android emulator, so 10.0.2.2 is alias for localhost
link: HttpLink(uri: "http://10.0.2.2:3000/graphql")));
}
//query is
static String placeholderQuery = """
query {
movies {
id
title
}
}""";
}
i know i'm doing something wrong, but not able to figure out.Please let me know if you need more information.
The text was updated successfully, but these errors were encountered: