AppSync with CDK Deploy Failed with :`명명 된 'AWSTimeStamp'스칼라 유형에 대한 스칼라 구현이 없습니다 .`

로렌 고든-판

언어 : TypeScript

도구 : Appsync 및 CDK

요약 : Graphql Schema에서 스칼라 AWSTimeStamp를 사용하려고합니다.

오류 메시지 :

UPDATE_FAILED | AWS::AppSync::GraphQLSchema Schema Creation Status is FAILED with details: Found 1 problem(s) with the schema: There is no scalar implementation for the named 'AWSTimeStamp' scalar type.

스키마 파일 :

index.graphql

schema {
  query: Query
  mutation: Mutation
}

type Query
type Mutation

scalar AWSTimeStamp

type Address {
  id: ID
  addressNickName: String
  address1: String
  address2: String
  attnTo: String
  city: String
  state: String
  zipCode: String
  country: String
  createdAt: AWSTimeStamp
  updatedAt: AWSTimeStamp
  isActive: Boolean
}

대리점 .graphql

extend type Mutation {
  createDealership(input: CreateDealershipInput): DealershipPayload
}

input CreateDealershipInput {
  engineId: ID!
  name: String
  slug: String
  address: AddressInput
}

type DealershipPayload {
  id: ID
  engineId: ID
  name: String
  slug: String
  salesAddressId: ID
  salesAddress: Address
}

input AddressInput {
  addressNickName: String
  address1: String
  address2: String
  attnTo: String
  city: String
  state: String
  zipCode: String
  country: String
}

참고 :이 두 graphql 파일은 스키마에 자동 병합됩니다.

schema.graphql

schema { 
  query: Query 
  mutation: Mutation   
}

type Address {
  id: ID
  addressNickName: String
  address1: String
  address2: String
  attnTo: String
  city: String
  state: String
  zipCode: String
  country: String
  createdAt: AWSTimeStamp
  updatedAt: AWSTimeStamp
  isActive: Boolean
}

input AddressInput {
  addressNickName: String
  address1: String
  address2: String
  attnTo: String
  city: String
  state: String
  zipCode: String
  country: String
}

scalar AWSTimeStamp

input CreateDealershipInput {
  engineId: ID!
  name: String
  slug: String
  address: AddressInput
}

type DealershipPayload {
  id: ID
  engineId: ID
  name: String
  slug: String
  salesAddressId: ID
  salesAddress: Address
}

type Mutation {
  createDealership(input: CreateDealershipInput): DealershipPayload
}

'스칼라 AWSTimeStamp'를 제거하고 AWSTimeStamp 유형을 'String'으로 바꾸면 배포가 성공합니다. AWSTimeStamp 스칼라를 사용하기 위해 무언가를 가져와야하는지 확실하지 않습니다. 이 문서 https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-appsync.GraphqlType.html을 보고 있지만 이것이있는 경우이 가져 오기를 어디에 삽입할지 확실하지 않습니다. -내가 필요한 것을 사실로. 저는 GraphQL과 CDK를 처음 접했습니다. 나는 약간의 안내를 기대합니다! 감사합니다.

제임슨

당신은이 AWSTimeStamp대문자로 S하지만, AppSync 스칼라 유형은 AWSTimestamp소문자로 s.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

Related 관련 기사

뜨겁다태그

보관