driesvints / sponsors

A package for PHP to interact with GitHub Sponsors.
MIT License
104 stars 7 forks source link

Drop organization methods #4

Closed driesvints closed 2 years ago

driesvints commented 2 years ago

Ideally we'd like to get rid of the organization methods so the user doesn't needs to know up front if they're checking a user or organization. An idea opted by @claudiodekker was to perform both the user and organization query with the username login and check which one would give the result:

query { 
  user(login: "driesvints") {
    viewerIsSponsoring
  },
  organization(login: "driesvints") {
    viewerIsSponsoring
  }
}

I think this would work. We'd have to rewrite some internals but then we could drop organization specific methods in the library.