apollographql / apollographql/apollo-client-devtools

Chrome Apollo Client Extension does not see schema for local state.

Open
#239 29 comments 31 reactions 0 assignees View on GitHub
🐞 bug
Dominant language
TypeScript
Stars
1.5k
Forks
172
Avg merge
10m
Merged PRs (30d)
8

Description

Hi there. Basically i've started doing some pet project and decided not to create a server itself but use local state management for now.

I'm doing the following thing:

```javascript
const cache = new InMemoryCache();

const client = new ApolloClient({
cache,
resolvers,
typeDefs
});

cache.writeData({
data: {
appState: {
isCollapsed: true,
__typename: 'AppState'
}
},
});
const applicationContainer = document.getElementById('application-root');
const application = (

>

);
ReactDOM.render(application, applicationContainer);
```
Here is schema:
```javascript
export const typeDefs = gql`
type Query {
appState: AppState
}

type AppState {
isCollapsed: Boolean
}
`;
```
And here is resolvers
```javascript
export const GET_APP_STATE = gql`
query GetAppState {
appState @client
}
`;

export const resolvers = {
Query:{
appState: ( _, { cache }) => {
const { appState } = cache.readQuery({ query: GET_APP_STATE });
return appState;
},
}
};
```
When i run Apollo Dev tools in chrome i expect to see schema but it's empty. Query works as expected.

![image](https://user-images.githubusercontent.com/6003658/70109757-ea0e7c00-161a-11ea-80fe-363e72752b75.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.