feat: organizations and API keys
This commit is contained in:
+35
-4
@@ -1,10 +1,33 @@
|
||||
type Query {
|
||||
subGraphs(ref: String!): [SubGraph!]! @hasApiKey @deprecated(reason: "Use supergraph instead")
|
||||
supergraph(ref: String!, isAfter: String): Supergraph! @hasApiKey
|
||||
organizations: [Organization!]! @auth(user: true)
|
||||
supergraph(ref: String!, isAfter: String): Supergraph! @auth(organization: true)
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
updateSubGraph(input: InputSubGraph!): SubGraph! @hasApiKey
|
||||
addOrganization(name: String!): Organization! @auth(user: true)
|
||||
addAPIKey(input: InputAPIKey): APIKey! @auth(user: true)
|
||||
updateSubGraph(input: InputSubGraph!): SubGraph! @auth(organization: true)
|
||||
}
|
||||
|
||||
type Organization {
|
||||
id: ID!
|
||||
name: String!
|
||||
users: [User!]!
|
||||
apiKeys: [APIKey!]!
|
||||
}
|
||||
|
||||
type User {
|
||||
id: String!
|
||||
}
|
||||
|
||||
type APIKey {
|
||||
id: ID!
|
||||
name: String!
|
||||
key: String
|
||||
organization: Organization!
|
||||
refs: [String!]!
|
||||
read: Boolean!
|
||||
publish: Boolean!
|
||||
}
|
||||
|
||||
union Supergraph = Unchanged | SubGraphs
|
||||
@@ -30,6 +53,14 @@ type SubGraph {
|
||||
changedAt: Time!
|
||||
}
|
||||
|
||||
input InputAPIKey {
|
||||
name: String!
|
||||
organizationId: ID!
|
||||
refs: [String!]!
|
||||
read: Boolean!
|
||||
publish: Boolean!
|
||||
}
|
||||
|
||||
input InputSubGraph {
|
||||
ref: String!
|
||||
service: String!
|
||||
@@ -40,4 +71,4 @@ input InputSubGraph {
|
||||
|
||||
scalar Time
|
||||
|
||||
directive @hasApiKey on FIELD_DEFINITION
|
||||
directive @auth(user: Boolean, organization: Boolean) on FIELD_DEFINITION
|
||||
|
||||
Reference in New Issue
Block a user