question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: createLocalInterface

See original GitHub issue

Would it be beneficial to have a createLocalInterface when you initially are trying out apollo-client / graphql in an existing stack?

The apollo-client and graphql can be a good alternative to all the redux boilerplating when it comes to maintaining a client cache/pagination/optimistic updates etc.

For now I basically just set up graphql schemas on the client and connected it directly to the ApolloClient via a basic interface. The interface it not much code but it might not be the first thing newcommers would figure out.

The apollo client dev tools seem to be working out of the box with the client-side only interface. except it needs to be closed on hmr - it’s not reconnecting/reloading when in graphiql

I propose something like:

import { ApolloClient, createLocalInterface } from 'react-apollo';
import schema from './schema';

const localInterface = createLocalInterface(schema);

const client = new ApolloClient({
  networkInterface: localInterface
});

networkInterface doesn’t feel like the best name match for this case though

If needed I can do a pr with code and examples

Kind regards Morten

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
raixcommented, May 2, 2017

I think I’ll name it createSchemaInterface for now. I’ll have a pr ready tomorrow

1reaction
raixcommented, Apr 10, 2017

The graphql schema resolveres could use rest endpoints or mock data.

It could be new users, or like in my case we dont have a graphql server yet - but I still want to leverage the Apollo client (I’m not keen on writing redux boilerplate code for defining a client cache for server data)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Request Features in ASP.NET Core | Microsoft Learn
Learn about web server implementation details related to HTTP requests and responses that are defined in interfaces for ASP.NET Core.
Read more >
Add local networks alias · Issue #1241 · opnsense/core - GitHub
I have no problem with adding some simple logic to the aliases for selecting (only static) nets for specified interfaces (a bit like...
Read more >
Fortinet Feature Requests - Weberblog.net
[DNS] The FortiGate can be used as a DNS proxy. It forwards DNS queries to its recursive DNS server.
Read more >
Feature Request : Improve/New Local Storage - Construct 3
The idea is save all the events possible and do all in the properties and in an interface similar to the "instance variables"....
Read more >
describe-local-gateway-virtual-interface-groups
--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found