10
45
Fork
You've already forked doipjs
28

Use more generic Account entity rather than Collective entity #55

Merged
yarmo merged 1 commit from aspensmonster/doipjs:opencollective-account into dev 2023年09月14日 17:34:34 +02:00
Contributor
Copy link

As per

https://graphql-docs-v2.opencollective.com/types/Account

Account interface shared by all kind of accounts (Bot, Collective,
Event, User, Organization)

I ran into trouble originally in

keyoxide/keyoxide-web#166

trying to figure out why a keypair parsing was failing (invalid URI on one of the signatures). Then, after addressing that via #54, I kept digging to see why the OpenCollective entry was failing, as the entity existed on OpenCollective:

https://opencollective.com/arubes

and had the following in its long description:

openpgp4fpr:68F640A166E2AD7BD22647B75E1A61D9DC1E1C73

So it should have worked. Looking at the response, arubes in OpenCollective is not a Collective type, but an Individual type. Querying the Account type works not only for Collective and the aforementioned other types (Bot, Event, User, Organization), but appears also to return Individual types too:

$ cat oc4.json 
{
	"query": "query { account(slug: \"arubes\") { longDescription } }"
}
$ curl -H 'Content-Type: application/json' -X POST https://api.opencollective.com/graphql/v2 -d@oc4.json
{"data":{"account":{"longDescription":"<div> openpgp4fpr:68F640A166E2AD7BD22647B75E1A61D9DC1E1C73 </div>"}}}
$

Querying on this entity should, in theory, be more general and handle more types of OpenCollective users.

As per https://graphql-docs-v2.opencollective.com/types/Account >Account interface shared by all kind of accounts (Bot, Collective, Event, User, Organization) I ran into trouble originally in https://codeberg.org/keyoxide/keyoxide-web/issues/166 trying to figure out why a keypair parsing was failing (invalid URI on one of the signatures). Then, after addressing that via #54, I kept digging to see why the OpenCollective entry was failing, as the entity existed on OpenCollective: https://opencollective.com/arubes and had the following in its long description: `openpgp4fpr:68F640A166E2AD7BD22647B75E1A61D9DC1E1C73 ` So it should have worked. Looking at the response, `arubes` in OpenCollective is not a `Collective` type, but an `Individual` type. Querying the `Account` type works not only for `Collective` and the aforementioned other types (`Bot`, `Event`, `User`, `Organization`), but appears also to return `Individual` types too: ``` $ cat oc4.json { "query": "query { account(slug: \"arubes\") { longDescription } }" } $ curl -H 'Content-Type: application/json' -X POST https://api.opencollective.com/graphql/v2 -d@oc4.json {"data":{"account":{"longDescription":"<div> openpgp4fpr:68F640A166E2AD7BD22647B75E1A61D9DC1E1C73 </div>"}}} $ ``` Querying on this entity should, in theory, be more general and handle more types of OpenCollective users.
As per
https://graphql-docs-v2.opencollective.com/types/Account
>Account interface shared by all kind of accounts (Bot, Collective,
Event, User, Organization)
Owner
Copy link

Good catch! Thanks for making a PR for this

Good catch! Thanks for making a PR for this
Sign in to join this conversation.
No reviewers
Labels
Clear labels
bug
Something is not working

Archived

enhancement
New feature

Archived

Contribution welcome
Get started contributing here
Good first issue
Good if you are new to the project or to open source contributions
Impact
External
Affects the people using the project
Impact
Internal
Affects on the people working on the project
Priority
Critical
Work on right now
Priority
High
Work on at earliest convenience
Priority
Low
Work on in spare time
Priority
Medium
Work on regularly
Review
Duplicate
Already exists
Review
Off Topic
Does not fall within the scope of the repo/project
Status
Backlog
Is not being worked on yet
Status
Blocked
Is waiting on something or someone
Status
Completed
Is done
Status
In Progress
Is being worked on
Status
Investigating
Is waiting on research or questions
Status
Needs Decision
Is waiting on a decision by the devs/contributors
Status
Needs Info
Is waiting on additional information before it can be solved
Status
Needs Triage
Is new issue that needs reviewing
Status
Testing
Is being checked and verified
Status
Waiting For Review
Is waiting on reviewers to approve
Status
Won't Fix
Won't be fixed
Type
Bug
Related to something not working as intended
Type
CI
Related to continuous integration
Type
Documentation
Related to documentation
Type
Enhancement
Related to a new feature or an improved one
Type
New Claim
Related to a new identity claim/proof
Type
Security
Related to security
Type
Tests
Related to code tests
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
keyoxide/doipjs!55
Reference in a new issue
keyoxide/doipjs
No description provided.
Delete branch "aspensmonster/doipjs:opencollective-account"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?