Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting directive in Fragments #11

Open
czystyl opened this issue Apr 30, 2018 · 4 comments
Open

Supporting directive in Fragments #11

czystyl opened this issue Apr 30, 2018 · 4 comments

Comments

@czystyl
Copy link
Owner

czystyl commented Apr 30, 2018

No description provided.

@veeramarni
Copy link

is it supported in fragments?

@czystyl
Copy link
Owner Author

czystyl commented Sep 8, 2019

As you can see on the title. It's not working with fragment yet.

@veeramarni
Copy link

veeramarni commented Sep 8, 2019

Understood. Do you have plans to support it? I could spend some time on it. Besides I was looking for cacheRedirect to work for types do you have any suggestions for it.

const cache = new InMemoryCache({
  cacheRedirects: {
    Query: {
      book: (_, args) => toIdValue(cache.config.dataIdFromObject({ __typename: 'Book', id: args.id })),
    },
  },
});

instead, also make it work for types as below.

const cache = new InMemoryCache({
  cacheRedirects: {
    publisher: {
      book: (_, args) => toIdValue(cache.config.dataIdFromObject({ __typename: 'Book', id: args.id })),
    },
  },
});

@czystyl
Copy link
Owner Author

czystyl commented Sep 9, 2019

I'd love to support fragments so if you want to help - PR's welcome.

What do you mean on your second question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants