Skip to content

Commit

Permalink
chore(galaxy): Scope resolver (#2761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosmin-Parvulescu authored Nov 20, 2023
1 parent 1c62d7b commit 8d0919a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 155 deletions.
10 changes: 0 additions & 10 deletions packages/galaxy-client/gql/apps.graphql

This file was deleted.

51 changes: 0 additions & 51 deletions packages/galaxy-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export type Mutation = {
__typename?: 'Mutation';
disconnectAccount?: Maybe<Scalars['Boolean']>;
registerSessionKey: Scalars['String'];
revokeAppAuthorization?: Maybe<Scalars['Boolean']>;
updateAccountNickname?: Maybe<Scalars['Boolean']>;
updateConnectedAccountsProperties?: Maybe<Scalars['Boolean']>;
};
Expand All @@ -66,11 +65,6 @@ export type MutationRegisterSessionKeyArgs = {
};


export type MutationRevokeAppAuthorizationArgs = {
clientId: Scalars['String'];
};


export type MutationUpdateAccountNicknameArgs = {
accountURN: Scalars['String'];
nickname: Scalars['String'];
Expand Down Expand Up @@ -126,7 +120,6 @@ export type Query = {
connectedAccounts?: Maybe<Array<Node>>;
identityFromAlias: Scalars['String'];
profile?: Maybe<Profile>;
scopes: Array<Maybe<Scope>>;
};


Expand Down Expand Up @@ -155,17 +148,6 @@ export type QueryProfileArgs = {
targetIdentityURN?: InputMaybe<Scalars['String']>;
};


export type QueryScopesArgs = {
clientId: Scalars['String'];
};

export type Scope = {
__typename?: 'Scope';
permission: Scalars['String'];
scopes: Array<Maybe<Scalars['String']>>;
};

export type StandardPfp = {
__typename?: 'StandardPFP';
image?: Maybe<Scalars['String']>;
Expand Down Expand Up @@ -208,20 +190,6 @@ export type UpdateConnectedAccountsPropertiesMutationVariables = Exact<{

export type UpdateConnectedAccountsPropertiesMutation = { __typename?: 'Mutation', updateConnectedAccountsProperties?: boolean | null };

export type GetAuthorizedAppScopesQueryVariables = Exact<{
clientId: Scalars['String'];
}>;


export type GetAuthorizedAppScopesQuery = { __typename?: 'Query', scopes: Array<{ __typename?: 'Scope', permission: string, scopes: Array<string | null> } | null> };

export type RevokeAppAuthorizationMutationVariables = Exact<{
clientId: Scalars['String'];
}>;


export type RevokeAppAuthorizationMutation = { __typename?: 'Mutation', revokeAppAuthorization?: boolean | null };

export type GetProfileQueryVariables = Exact<{
targetIdentityURN?: InputMaybe<Scalars['String']>;
}>;
Expand Down Expand Up @@ -286,19 +254,6 @@ export const UpdateConnectedAccountsPropertiesDocument = gql`
updateConnectedAccountsProperties(accountURNList: $accountURNList)
}
`;
export const GetAuthorizedAppScopesDocument = gql`
query getAuthorizedAppScopes($clientId: String!) {
scopes(clientId: $clientId) {
permission
scopes
}
}
`;
export const RevokeAppAuthorizationDocument = gql`
mutation revokeAppAuthorization($clientId: String!) {
revokeAppAuthorization(clientId: $clientId)
}
`;
export const GetProfileDocument = gql`
query getProfile($targetIdentityURN: String) {
profile(targetIdentityURN: $targetIdentityURN) {
Expand Down Expand Up @@ -362,12 +317,6 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper =
updateConnectedAccountsProperties(variables: UpdateConnectedAccountsPropertiesMutationVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<UpdateConnectedAccountsPropertiesMutation> {
return withWrapper((wrappedRequestHeaders) => client.request<UpdateConnectedAccountsPropertiesMutation>(UpdateConnectedAccountsPropertiesDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'updateConnectedAccountsProperties', 'mutation');
},
getAuthorizedAppScopes(variables: GetAuthorizedAppScopesQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GetAuthorizedAppScopesQuery> {
return withWrapper((wrappedRequestHeaders) => client.request<GetAuthorizedAppScopesQuery>(GetAuthorizedAppScopesDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getAuthorizedAppScopes', 'query');
},
revokeAppAuthorization(variables: RevokeAppAuthorizationMutationVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<RevokeAppAuthorizationMutation> {
return withWrapper((wrappedRequestHeaders) => client.request<RevokeAppAuthorizationMutation>(RevokeAppAuthorizationDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'revokeAppAuthorization', 'mutation');
},
getProfile(variables?: GetProfileQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GetProfileQuery> {
return withWrapper((wrappedRequestHeaders) => client.request<GetProfileQuery>(GetProfileDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getProfile', 'query');
},
Expand Down
3 changes: 1 addition & 2 deletions platform/galaxy/src/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mergeTypeDefs } from '@graphql-tools/merge'
import GraphQLJSON from 'graphql-type-json'

import types from './types'
import { accountResolver, appResolver, identityResolver } from './resolvers'
import { accountResolver, identityResolver } from './resolvers'
import { GalaxyServerContext } from '..'

const mergedTypes = mergeTypeDefs(types)
Expand All @@ -12,7 +12,6 @@ export default createSchema<GalaxyServerContext>({
typeDefs: mergedTypes,
resolvers: [
accountResolver,
appResolver,
identityResolver,
{
JSON: GraphQLJSON,
Expand Down
74 changes: 0 additions & 74 deletions platform/galaxy/src/schema/resolvers/app.ts

This file was deleted.

3 changes: 1 addition & 2 deletions platform/galaxy/src/schema/resolvers/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import identityResolver from './identity'
import accountResolver from './account'
import appResolver from './app'

export { identityResolver, accountResolver, appResolver }
export { identityResolver, accountResolver }
14 changes: 0 additions & 14 deletions platform/galaxy/src/schema/types/app.ts

This file was deleted.

3 changes: 1 addition & 2 deletions platform/galaxy/src/schema/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ import common from './common'
import edges from './edges'
import account from './account'
import identity from './identity'
import app from './app'

export default [common, edges, account, identity, app]
export default [common, edges, account, identity]

0 comments on commit 8d0919a

Please sign in to comment.