mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-11-04 04:39:10 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			390 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			GraphQL
		
	
	
	
	
	
			
		
		
	
	
			390 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			GraphQL
		
	
	
	
	
	
scalar Long
 | 
						|
 | 
						|
schema {
 | 
						|
    query: Query
 | 
						|
    mutation: Mutation
 | 
						|
}
 | 
						|
 | 
						|
type Query {
 | 
						|
    dataset(urn: String!): Dataset
 | 
						|
    user(urn: String!): CorpUser
 | 
						|
    search(input: SearchInput!): SearchResults
 | 
						|
    autoComplete(input: AutoCompleteInput!): AutoCompleteResults
 | 
						|
    browse(input: BrowseInput!): BrowseResults
 | 
						|
    browsePaths(input: BrowsePathsInput!): [[String!]!]
 | 
						|
}
 | 
						|
 | 
						|
type Mutation {
 | 
						|
    logIn(username: String!, password: String!): CorpUser
 | 
						|
    updateDataset(input: DatasetUpdateInput!): Dataset
 | 
						|
}
 | 
						|
 | 
						|
input DatasetUpdateInput {
 | 
						|
    urn: String!
 | 
						|
    ownership: OwnershipUpdate
 | 
						|
}
 | 
						|
 | 
						|
input OwnershipUpdate {
 | 
						|
    owners: [OwnerUpdate!]
 | 
						|
}
 | 
						|
 | 
						|
input OwnerUpdate {
 | 
						|
    # The owner URN, eg urn:li:corpuser:1
 | 
						|
    owner: String!
 | 
						|
 | 
						|
    # The owner role type
 | 
						|
    type: OwnershipType!
 | 
						|
}
 | 
						|
 | 
						|
enum OwnershipSourceType {
 | 
						|
    AUDIT
 | 
						|
    DATABASE
 | 
						|
    FILE_SYSTEM
 | 
						|
    ISSUE_TRACKING_SYSTEM
 | 
						|
    MANUAL
 | 
						|
    SERVICE
 | 
						|
    SOURCE_CONTROL
 | 
						|
    OTHER
 | 
						|
}
 | 
						|
 | 
						|
type OwnershipSource {
 | 
						|
    """
 | 
						|
    The type of the source
 | 
						|
    """
 | 
						|
    type: OwnershipSourceType!
 | 
						|
 | 
						|
    """
 | 
						|
    A reference URL for the source
 | 
						|
    """
 | 
						|
    url: String
 | 
						|
}
 | 
						|
 | 
						|
enum OwnershipType {
 | 
						|
    """
 | 
						|
    A person or group that is in charge of developing the code
 | 
						|
    """
 | 
						|
    DEVELOPER
 | 
						|
 | 
						|
    """
 | 
						|
    A person or group that is owning the data
 | 
						|
    """
 | 
						|
    DATAOWNER
 | 
						|
 | 
						|
    """
 | 
						|
    A person or a group that overseas the operation, e.g. a DBA or SRE.
 | 
						|
    """
 | 
						|
    DELEGATE
 | 
						|
 | 
						|
    """
 | 
						|
    A person, group, or service that produces/generates the data
 | 
						|
    """
 | 
						|
    PRODUCER
 | 
						|
 | 
						|
    """
 | 
						|
    A person, group, or service that consumes the data
 | 
						|
    """
 | 
						|
    CONSUMER
 | 
						|
 | 
						|
    """
 | 
						|
    A person or a group that has direct business interest
 | 
						|
    """
 | 
						|
    STAKEHOLDER
 | 
						|
}
 | 
						|
 | 
						|
type Owner {
 | 
						|
    """
 | 
						|
    Owner object
 | 
						|
    """
 | 
						|
    owner: CorpUser!
 | 
						|
 | 
						|
    """
 | 
						|
    The type of the ownership
 | 
						|
    """
 | 
						|
    type: OwnershipType
 | 
						|
 | 
						|
    """
 | 
						|
    Source information for the ownership
 | 
						|
    """
 | 
						|
    source: OwnershipSource
 | 
						|
}
 | 
						|
 | 
						|
type Ownership {
 | 
						|
    owners: [Owner!]
 | 
						|
 | 
						|
    lastModified: Long!
 | 
						|
}
 | 
						|
 | 
						|
enum FabricType {
 | 
						|
    """
 | 
						|
    Designates development fabrics
 | 
						|
    """
 | 
						|
    DEV
 | 
						|
 | 
						|
    """
 | 
						|
    Designates early-integration (staging) fabrics
 | 
						|
    """
 | 
						|
    EI
 | 
						|
 | 
						|
    """
 | 
						|
    Designates production fabrics
 | 
						|
    """
 | 
						|
    PROD
 | 
						|
 | 
						|
    """
 | 
						|
    Designates corporation fabrics
 | 
						|
    """
 | 
						|
    CORP
 | 
						|
}
 | 
						|
 | 
						|
enum PlatformNativeType {
 | 
						|
    """
 | 
						|
    Table
 | 
						|
    """
 | 
						|
    TABLE
 | 
						|
 | 
						|
    """
 | 
						|
    View
 | 
						|
    """
 | 
						|
    VIEW
 | 
						|
 | 
						|
    """
 | 
						|
    Directory in file system
 | 
						|
    """
 | 
						|
    DIRECTORY
 | 
						|
 | 
						|
    """
 | 
						|
    Stream
 | 
						|
    """
 | 
						|
    STREAM
 | 
						|
 | 
						|
    """
 | 
						|
    Bucket in key value store
 | 
						|
    """
 | 
						|
    BUCKET
 | 
						|
}
 | 
						|
 | 
						|
type PropertyTuple {
 | 
						|
    key: String!
 | 
						|
    value: String
 | 
						|
}
 | 
						|
 | 
						|
type SubTypes {
 | 
						|
    typeNames: [String!]
 | 
						|
}
 | 
						|
 | 
						|
type Dataset {
 | 
						|
    urn: String!
 | 
						|
 | 
						|
    platform: String!
 | 
						|
 | 
						|
    name: String!
 | 
						|
 | 
						|
    origin: FabricType!
 | 
						|
 | 
						|
    description: String
 | 
						|
 | 
						|
    uri: String
 | 
						|
 | 
						|
    platformNativeType: PlatformNativeType
 | 
						|
 | 
						|
    tags: [String!]!
 | 
						|
 | 
						|
    properties: [PropertyTuple!]
 | 
						|
 | 
						|
    createdTime: Long!
 | 
						|
 | 
						|
    modifiedTime: Long!
 | 
						|
 | 
						|
    ownership: Ownership
 | 
						|
 | 
						|
    subTypes: SubTypes
 | 
						|
}
 | 
						|
 | 
						|
type CorpUserInfo {
 | 
						|
    active: Boolean!
 | 
						|
 | 
						|
    displayName: String
 | 
						|
 | 
						|
    email: String!
 | 
						|
 | 
						|
    title: String
 | 
						|
 | 
						|
    manager: CorpUser
 | 
						|
 | 
						|
    departmentId: Long
 | 
						|
 | 
						|
    departmentName: String
 | 
						|
 | 
						|
    firstName: String
 | 
						|
 | 
						|
    lastName: String
 | 
						|
 | 
						|
    fullName: String
 | 
						|
 | 
						|
    countryCode: String
 | 
						|
}
 | 
						|
 | 
						|
type CorpUserEditableInfo {
 | 
						|
    aboutMe: String
 | 
						|
 | 
						|
    teams: [String!]
 | 
						|
 | 
						|
    skills: [String!]
 | 
						|
 | 
						|
    pictureLink: String
 | 
						|
}
 | 
						|
 | 
						|
type CorpUser {
 | 
						|
    urn: String!
 | 
						|
 | 
						|
    username: String!
 | 
						|
 | 
						|
    info: CorpUserInfo
 | 
						|
 | 
						|
    editableInfo: CorpUserEditableInfo
 | 
						|
}
 | 
						|
 | 
						|
type CorpGroup implements Entity {
 | 
						|
    """
 | 
						|
    The unique user URN
 | 
						|
    """
 | 
						|
    urn: String!
 | 
						|
 | 
						|
    """
 | 
						|
    GMS Entity Type
 | 
						|
    """
 | 
						|
    type: EntityType!
 | 
						|
 | 
						|
    """
 | 
						|
    group name e.g. wherehows-dev, ask_metadata
 | 
						|
    """
 | 
						|
    name: String
 | 
						|
 | 
						|
    """
 | 
						|
    Information of the corp group
 | 
						|
    """
 | 
						|
    info: CorpGroupInfo
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
type CorpGroupInfo {
 | 
						|
    """
 | 
						|
    email of this group
 | 
						|
    """
 | 
						|
    email: String!
 | 
						|
 | 
						|
    """
 | 
						|
    owners of this group
 | 
						|
    """
 | 
						|
    admins: [String!]!
 | 
						|
 | 
						|
    """
 | 
						|
    List of ldap urn in this group.
 | 
						|
    """
 | 
						|
    members: [String!]!
 | 
						|
 | 
						|
    """
 | 
						|
    List of groups in this group.
 | 
						|
    """
 | 
						|
    groups: [String!]!
 | 
						|
}
 | 
						|
 | 
						|
enum EntityType {
 | 
						|
    DATASET
 | 
						|
    USER
 | 
						|
    DATA_FLOW
 | 
						|
    DATA_JOB
 | 
						|
    CORP_USER
 | 
						|
    CORP_GROUP
 | 
						|
}
 | 
						|
 | 
						|
# Search Input
 | 
						|
input SearchInput {
 | 
						|
    type: EntityType!
 | 
						|
    query: String!
 | 
						|
    start: Int
 | 
						|
    count: Int
 | 
						|
    filters: [FacetFilterInput!]
 | 
						|
}
 | 
						|
 | 
						|
input FacetFilterInput {
 | 
						|
    field: String! # Facet Field Name
 | 
						|
    value: String! # Facet Value
 | 
						|
}
 | 
						|
 | 
						|
# Search Output
 | 
						|
type SearchResults {
 | 
						|
    start: Int!
 | 
						|
    count: Int!
 | 
						|
    total: Int!
 | 
						|
    elements: [SearchResult!]!
 | 
						|
    facets: [FacetMetadata!]
 | 
						|
}
 | 
						|
 | 
						|
union SearchResult = Dataset | CorpUser
 | 
						|
 | 
						|
type FacetMetadata {
 | 
						|
    field: String!
 | 
						|
    aggregations: [AggregationMetadata!]!
 | 
						|
}
 | 
						|
 | 
						|
type AggregationMetadata {
 | 
						|
    value: String!
 | 
						|
    count: Long!
 | 
						|
}
 | 
						|
 | 
						|
# Autocomplete Input
 | 
						|
input AutoCompleteInput {
 | 
						|
    type: EntityType!
 | 
						|
    query: String!
 | 
						|
    field: String # Field name
 | 
						|
    limit: Int
 | 
						|
    filters: [FacetFilterInput!]
 | 
						|
}
 | 
						|
 | 
						|
# Autocomplete Output
 | 
						|
type AutoCompleteResults {
 | 
						|
    query: String!
 | 
						|
    suggestions: [String!]!
 | 
						|
}
 | 
						|
 | 
						|
# Browse Inputs
 | 
						|
input BrowseInput {
 | 
						|
    type: EntityType!
 | 
						|
    path: [String!]
 | 
						|
    start: Int
 | 
						|
    count: Int
 | 
						|
    filters: [FacetFilterInput!]
 | 
						|
}
 | 
						|
 | 
						|
# Browse Output
 | 
						|
type BrowseResults {
 | 
						|
    entities: [BrowseResultEntity!]!
 | 
						|
    start: Int!
 | 
						|
    count: Int!
 | 
						|
    total: Int!
 | 
						|
    metadata: BrowseResultMetadata!
 | 
						|
}
 | 
						|
 | 
						|
type BrowseResultEntity {
 | 
						|
    name: String!
 | 
						|
    urn: String!
 | 
						|
}
 | 
						|
 | 
						|
type BrowseResultMetadata {
 | 
						|
    path: [String!]
 | 
						|
    groups: [BrowseResultGroup!]!
 | 
						|
    totalNumEntities: Long!
 | 
						|
}
 | 
						|
 | 
						|
type BrowseResultGroup {
 | 
						|
    name: String!
 | 
						|
    count: Long!
 | 
						|
}
 | 
						|
 | 
						|
# Browse Paths Input
 | 
						|
input BrowsePathsInput {
 | 
						|
    type: EntityType!
 | 
						|
    urn: String!
 | 
						|
}
 |