ソースを参照

DevOps

- add cors
Alexey Kim 1 年間 前
コミット
c1893cc76b
2 ファイル変更112 行追加0 行削除
  1. 108 0
      devops/prod-schema.graphql
  2. 4 0
      devops/router.yaml

+ 108 - 0
devops/prod-schema.graphql

@@ -0,0 +1,108 @@
+schema
+  @link(url: "https://specs.apollo.dev/link/v1.0")
+  @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION)
+{
+  query: Query
+  mutation: Mutation
+}
+
+directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE
+
+directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
+
+directive @join__graph(name: String!, url: String!) on ENUM_VALUE
+
+directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE
+
+directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR
+
+directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION
+
+directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA
+
+type AccessTokenResponse
+  @join__type(graph: AUTH)
+{
+  access_token: String!
+  id_token: String!
+  token_type: String!
+  expires_in: Int!
+  refresh_token: String!
+  refresh_expires_in: Int!
+  not_before_policy: Int!
+  session_state: String!
+  scope: [String!]!
+}
+
+input Credentials
+  @join__type(graph: AUTH)
+{
+  username: String!
+  password: String!
+}
+
+scalar DateTime
+  @join__type(graph: AUTH)
+
+enum ErrorAuth
+  @join__type(graph: AUTH)
+{
+  ILLEGAL_USERNAME @join__enumValue(graph: AUTH)
+  ALREADY_EXISTS @join__enumValue(graph: AUTH)
+  INVALID_ARGUMENT @join__enumValue(graph: AUTH)
+}
+
+scalar join__FieldSet
+
+enum join__Graph {
+  AUTH @join__graph(name: "auth", url: "https://auth.craft.beejay.kim")
+}
+
+scalar link__Import
+
+enum link__Purpose {
+  """
+  `SECURITY` features provide metadata necessary to securely resolve fields.
+  """
+  SECURITY
+
+  """
+  `EXECUTION` features provide metadata necessary for operation execution.
+  """
+  EXECUTION
+}
+
+type Mutation
+  @join__type(graph: AUTH)
+{
+  Signup(credentials: Credentials!): String
+  Login(credentials: Credentials!): AccessTokenResponse
+  RefreshToken(token: String!): AccessTokenResponse
+}
+
+interface Node
+  @join__type(graph: AUTH)
+{
+  id: ID!
+}
+
+type Query
+  @join__type(graph: AUTH)
+{
+  User(id: ID!): User
+}
+
+type User implements Node
+  @join__implements(graph: AUTH, interface: "Node")
+  @join__type(graph: AUTH, key: "id")
+{
+  id: ID!
+  username: String!
+  created_at: DateTime!
+  enabled: Boolean!
+  email_verified: Boolean!
+  first_name: String
+  last_name: String
+  email: String
+  level: Int!
+}

+ 4 - 0
devops/router.yaml

@@ -21,6 +21,10 @@ headers:
       - propagate:
           named: "X-Instance-ID"
 
+cors:
+  origins:
+    - http://localhost:3000
+
 traffic_shaping:
   deduplicate_variables: true
   router: