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

Toggle follow partner doesn't always purge GraphCDN #103

Open
brettski opened this issue Jun 3, 2022 · 0 comments
Open

Toggle follow partner doesn't always purge GraphCDN #103

brettski opened this issue Jun 3, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@brettski
Copy link
Member

brettski commented Jun 3, 2022

When someone toggles to follow a partner, the cache for that partner (by id) is only purged when the user is added as a follower, not removed.

A basic toggle mutation is:

mutation togglePartnerFavorite {
  partners {
    favoriting(findBy: {slug: "google-cloud"}) {
      toggle {
	__typename
        id
        companyName
        slug
      }
    }
  }
}

The JSON Result is either:

{
	"data": {
		"partners": {
			"favoriting": {
				"toggle": {
					"__typename": "Partner",
					"id": "a9uFn5IBuCLmTfar7wLF",
					"companyName": "Google Cloud",
					"slug": "google-cloud"
				}
			}
		}
	}
}

or

{
	"data": {
		"partners": {
			"favoriting": {
				"toggle": null
			}
		}
	}
}

As you can see by the second result the response is NULL and will not trigger a purge at GraphCDN.

At this point I see two options to correct this.

a. Add a purging event to the partners API and trigger a purge when the toggle mutation is called
b. Refactor the response from the mutation so a value is always returned, though an additional field may be required to let the caller know if they are now following or not following the partner (currently known by the null/not null response).

@brettski brettski added the bug Something isn't working label Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant