-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
5,609 additions
and
1,803 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module ApiKeyMutations | ||
MUTATION_TARGET = 'api_key'.freeze | ||
PARENTS = ['team'].freeze | ||
|
||
class Create < Mutations::CreateMutation | ||
argument :title, GraphQL::Types::String, required: false | ||
argument :description, GraphQL::Types::String, required: false | ||
end | ||
|
||
class Destroy < Mutations::DestroyMutation; end | ||
end |
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,25 @@ | ||
module ExplainerMutations | ||
MUTATION_TARGET = 'explainer'.freeze | ||
PARENTS = ['team'].freeze | ||
|
||
module SharedCreateAndUpdateFields | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
argument :title, GraphQL::Types::String, required: true | ||
argument :description, GraphQL::Types::String, required: false | ||
argument :url, GraphQL::Types::String, required: false | ||
argument :language, GraphQL::Types::String, required: false | ||
end | ||
end | ||
|
||
class Create < Mutations::CreateMutation | ||
include SharedCreateAndUpdateFields | ||
end | ||
|
||
class Update < Mutations::UpdateMutation | ||
include SharedCreateAndUpdateFields | ||
end | ||
|
||
class Destroy < Mutations::DestroyMutation; end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class ApiKeyType < DefaultObject | ||
description "ApiKey type" | ||
|
||
implements GraphQL::Types::Relay::Node | ||
|
||
field :dbid, GraphQL::Types::Int, null: true | ||
field :team_id, GraphQL::Types::Int, null: true | ||
field :user_id, GraphQL::Types::Int, null: true | ||
field :title, GraphQL::Types::String, null: true | ||
field :access_token, GraphQL::Types::String, null: true | ||
field :description, GraphQL::Types::String, null: true | ||
field :application, GraphQL::Types::String, null: true | ||
field :expire_at, GraphQL::Types::String, null: true | ||
|
||
field :team, TeamType, null: true | ||
field :user, UserType, null: true | ||
end |
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,6 @@ | ||
class ArticleUnion < BaseUnion | ||
description 'A union type of all article types we can handle' | ||
possible_types( | ||
ExplainerType, | ||
) | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class ExplainerType < DefaultObject | ||
description "Explainer type" | ||
|
||
implements GraphQL::Types::Relay::Node | ||
|
||
field :dbid, GraphQL::Types::Int, null: true | ||
field :title, GraphQL::Types::String, null: true | ||
field :description, GraphQL::Types::String, null: true | ||
field :url, GraphQL::Types::String, null: true | ||
field :language, GraphQL::Types::String, null: true | ||
field :user_id, GraphQL::Types::Int, null: true | ||
field :team_id, GraphQL::Types::Int, null: true | ||
field :user, UserType, null: true | ||
field :team, PublicTeamType, null: true | ||
|
||
field :tags, TagType.connection_type, null: true | ||
|
||
def tags | ||
Tag.where(annotation_type: 'tag', annotated_type: object.class.name, annotated_id: object.id) | ||
end | ||
end |
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
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
Oops, something went wrong.