Coder Social home page Coder Social logo

Cache invalidation issue about aor-graphql HOT 4 CLOSED

vysakh0 avatar vysakh0 commented on May 2, 2024
Cache invalidation issue

from aor-graphql.

Comments (4)

djhi avatar djhi commented on May 2, 2024

Do not override this fetchPolicy

from aor-graphql.

vysakh0 avatar vysakh0 commented on May 2, 2024

@djhi Thank you for the quick response! I'm not overriding it. I'm using aor-graphql-client-graphcool

This is as far as my config gets.

    buildApolloClient({ client: { uri: `${process.env.REACT_APP_URL}` } }).then(
      restClient => this.setState({ restClient })
    );

Been stuck at this for a while, would be grateful if you could point what I'm doing wrong. 👍

// package.json

...
  "homepage": ".",
  "dependencies": {
    "admin-on-rest": "^1.2.0",
    "aor-graphql-client-graphcool": "^0.0.1-1",
    "aor-permissions": "^1.0.3",
    "graphql-request": "^1.3.2",
    "moment": "^2.18.1",
    "react": "^15.4.2",
    "react-apollo": "^1.4.8",
    "react-csv": "^1.0.8",
    "react-dom": "^15.4.2",
    "react-google-maps": "6.3.0",
    "subscriptions-transport-ws": "^0.8.1",
    "whatwg-fetch": "^2.0.3"
  },
  "devDependencies": {
    "prop-types": "^15.5.8",
    "react-scripts": "^1.0.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },

from aor-graphql.

vysakh0 avatar vysakh0 commented on May 2, 2024

To reproduce the bug, I have created a small repo https://github.com/vysakh0/aor-latest with just admin-on-rest and aor-graphql-client-graphcool library. Have the same issue (try deleting a record in that sample repo)

from aor-graphql.

vysakh0 avatar vysakh0 commented on May 2, 2024

Weirdly, it works with the latest 0.0.1 version 👍 when I'm defining my own ApolloClient.

import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { UserList, UserEdit, UserNew } from './users';

const client = new ApolloClient({
  link: new HttpLink({ uri:  `${process.env.REACT_APP_URL}`}),
  cache: new InMemoryCache()
});


class App extends React.Component {
  constructor() {
    super();
    this.state = { restClient: null };
  }
  componentDidMount() {

    buildApolloClient({ client }).then(
      restClient => this.setState({ restClient })
    );
  }

from aor-graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.