-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backend): add OData & GraphQL Service API interfaces
- this will help user making sure they use valid options in their Backend Services
- Loading branch information
1 parent
b894ee1
commit 11cc71c
Showing
13 changed files
with
93 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/app/modules/angular-slickgrid/models/graphqlServiceApi.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Observable } from 'rxjs'; | ||
|
||
import { BackendServiceApi } from './backendServiceApi.interface'; | ||
import { GraphqlResult } from './graphqlResult.interface'; | ||
import { GraphqlPaginatedResult } from './graphqlPaginatedResult.interface'; | ||
import { GraphqlServiceOption } from './graphqlServiceOption.interface'; | ||
import { GraphqlService } from '../services'; | ||
|
||
export interface GraphqlServiceApi extends BackendServiceApi { | ||
/** Backend Service Options */ | ||
options: GraphqlServiceOption; | ||
|
||
/** Backend Service instance (could be OData or GraphQL Service) */ | ||
service: GraphqlService; | ||
|
||
/** On init (or on page load), what action to perform? */ | ||
onInit?: (query: string) => Promise<GraphqlResult | GraphqlPaginatedResult> | Observable<GraphqlResult | GraphqlPaginatedResult>; | ||
|
||
/** On Processing, we get the query back from the service, and we need to provide a Promise/Observable. For example: this.http.get(myGraphqlUrl) */ | ||
process: (query: string) => Promise<GraphqlResult | GraphqlPaginatedResult> | Observable<GraphqlResult | GraphqlPaginatedResult>; | ||
|
||
/** After executing the query, what action to perform? For example, stop the spinner */ | ||
postProcess?: (response: GraphqlResult | GraphqlPaginatedResult) => void; | ||
|
||
/** | ||
* INTERNAL USAGE ONLY by Angular-Slickgrid | ||
* This internal process will be run just before postProcess and is meant to refresh the Dataset & Pagination after a GraphQL call | ||
*/ | ||
internalPostProcess?: (result: GraphqlResult | GraphqlPaginatedResult) => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/app/modules/angular-slickgrid/models/odataServiceApi.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BackendServiceApi } from './backendServiceApi.interface'; | ||
import { OdataOption } from './odataOption.interface'; | ||
import { GridOdataService } from '../services'; | ||
|
||
export interface OdataServiceApi extends BackendServiceApi { | ||
/** Backend Service Options */ | ||
options?: Partial<OdataOption>; | ||
|
||
/** Backend Service instance (could be OData or GraphQL Service) */ | ||
service: GridOdataService; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters