Created
November 3, 2020 20:38
-
-
Save joaquinacuna/17820f4ae3eed2c4c3774de9bbcf7036 to your computer and use it in GitHub Desktop.
GraphQL dart configuration file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "package:flutter/material.dart"; | |
import "package:graphql_flutter/graphql_flutter.dart"; | |
class GraphQLConfiguration { | |
static HttpLink httpLink = HttpLink( | |
uri: "http://127.0.0.1:8000/graphql", | |
); | |
ValueNotifier<GraphQLClient> client = ValueNotifier( | |
GraphQLClient( | |
link: httpLink, | |
cache: OptimisticCache(dataIdFromObject: typenameDataIdFromObject), | |
), | |
); | |
GraphQLClient clientToQuery() { | |
return GraphQLClient( | |
cache: OptimisticCache(dataIdFromObject: typenameDataIdFromObject), | |
link: httpLink, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment