0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【amplify】Module not found: Can't resolve './graphql/mutations' のエラー解消

Posted at

エラー発生

AWS amplifyのチュートリアルに沿ってTodoアプリを作ろうとしたところ、下記エラーが発生しました。

Module not found: Can't resolve './graphql/mutations' in '/Users/hoge/huga/src'

エラー文で検索をかけてみても、解決につながる記事に出会えなかったので、とりあえず最初からやり直すことにしました。

エラー発生源

チュートリアルに沿って進んでいくと、ターミナル上で質問形式になる箇所がいくつかあります。

その中の、おそらく下記ページでのやり取りで何か入力を間違えてしまっていたように思います。

ここと、

amplify add api
? Please select from one of the below mentioned services:
# GraphQL
? Provide API name:
# myapi
? Choose the default authorization type for the API:
# API Key
? Enter a description for the API key:
# demo //ここを何か違うことを書いてしまった気がする
? After how many days from now the API key should expire:
# 7 (or your preferred expiration)
? Do you want to configure advanced settings for the GraphQL API:
# No
? Do you have an annotated GraphQL schema?
# No
? Choose a schema template:
# Single object with fields (e.g., “Todo” with ID, name, description)
? Do you want to edit the schema now?
# Yes

ここ

amplify push
? Do you want to generate code for your newly created GraphQL API Yes
? Choose the code generation language target typescript // ここでTypeScriptを選ぶことで以後の質問が変わる
? Enter the file name pattern of graphql queries, mutations and subscriptions src/graphql/**/*.ts
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes
? Enter maximum statement depth [increase from default if your schema is deeply nested] 2
? Enter the file name for the generated code src/API.ts

まとめ

今回は、チュートリアルと違ってTypeScript × Reduxで作成しているので、基本的にはデフォルトの値で問題ないのですが、対応する質問などは注意しながらやっています。

引き続き、チュートリアルを進めていきます。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?