Skip to content

Commit

Permalink
graphqlV2: return hosts as Host and not as Organization
Browse files Browse the repository at this point in the history
  • Loading branch information
znarf committed Dec 18, 2023
1 parent 04a1ab3 commit 5ad94ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions server/graphql/v2/object/Host.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ export const GraphQLHost = new GraphQLObjectType({
name: 'Host',
description: 'This represents an Host account',
interfaces: () => [GraphQLAccount, GraphQLAccountWithContributions],
// Due to overlap between our Organization and Host types, we cannot use isTypeOf here
// isTypeOf: account => account.isHostAccount,
isTypeOf: collective => collective.type === 'ORGANIZATION' && collective.isHostAccount,
fields: () => {
return {
...AccountFields,
Expand Down
2 changes: 1 addition & 1 deletion server/graphql/v2/object/Organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const GraphQLOrganization = new GraphQLObjectType({
name: 'Organization',
description: 'This represents an Organization account',
interfaces: () => [GraphQLAccount, GraphQLAccountWithContributions],
isTypeOf: collective => collective.type === 'ORGANIZATION',
isTypeOf: collective => collective.type === 'ORGANIZATION' && !collective.isHostAccount,
fields: () => {
return {
...AccountFields,
Expand Down

0 comments on commit 5ad94ab

Please sign in to comment.