Skip to content

Commit 7b212a5

Browse files
committed
Mark AppSyncResolverTemplate as Deprecated
1 parent 6796528 commit 7b212a5

File tree

4 files changed

+4
-84
lines changed

4 files changed

+4
-84
lines changed

events/appsync.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package events
22

33
import "encoding/json"
44

5-
// AppSyncResolverTemplate represents the requests from AppSync to Lambda
5+
// Deprecated: AppSyncResolverTemplate does not represent resolver events sent by AppSync. Instead directly model your input schema, or use map[string]string, json.RawMessage, interface{}, etc..
66
type AppSyncResolverTemplate struct {
77
Version string `json:"version"`
88
Operation AppSyncOperation `json:"operation"`
@@ -31,13 +31,13 @@ type AppSyncCognitoIdentity struct {
3131
DefaultAuthStrategy string `json:"defaultAuthStrategy"`
3232
}
3333

34-
// AppSyncOperation specifies the operation type supported by Lambda operations
34+
// Deprecated: not used by any event schema
3535
type AppSyncOperation string
3636

3737
const (
38-
// OperationInvoke lets AWS AppSync know to call your Lambda function for every GraphQL field resolver
38+
// Deprecated: not used by any event schema
3939
OperationInvoke AppSyncOperation = "Invoke"
40-
// OperationBatchInvoke instructs AWS AppSync to batch requests for the current GraphQL field
40+
// Deprecated: not used by any event schema
4141
OperationBatchInvoke AppSyncOperation = "BatchInvoke"
4242
)
4343

events/appsync_test.go

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,6 @@ import (
99
"github.com/stretchr/testify/assert"
1010
)
1111

12-
func TestAppSyncResolverTemplate_invoke(t *testing.T) {
13-
inputJSON, err := ioutil.ReadFile("./testdata/appsync-invoke.json")
14-
if err != nil {
15-
t.Errorf("could not open test file. details: %v", err)
16-
}
17-
18-
var inputEvent AppSyncResolverTemplate
19-
if err = json.Unmarshal(inputJSON, &inputEvent); err != nil {
20-
t.Errorf("could not unmarshal event. details: %v", err)
21-
}
22-
assert.Equal(t, OperationInvoke, inputEvent.Operation)
23-
24-
outputJSON, err := json.Marshal(inputEvent)
25-
if err != nil {
26-
t.Errorf("could not marshal event. details: %v", err)
27-
}
28-
29-
assert.JSONEq(t, string(inputJSON), string(outputJSON))
30-
}
31-
32-
func TestAppSyncResolverTemplate_batchinvoke(t *testing.T) {
33-
inputJSON, err := ioutil.ReadFile("./testdata/appsync-batchinvoke.json")
34-
if err != nil {
35-
t.Errorf("could not open test file. details: %v", err)
36-
}
37-
38-
var inputEvent AppSyncResolverTemplate
39-
if err = json.Unmarshal(inputJSON, &inputEvent); err != nil {
40-
t.Errorf("could not unmarshal event. details: %v", err)
41-
}
42-
assert.Equal(t, OperationBatchInvoke, inputEvent.Operation)
43-
44-
outputJSON, err := json.Marshal(inputEvent)
45-
if err != nil {
46-
t.Errorf("could not marshal event. details: %v", err)
47-
}
48-
49-
assert.JSONEq(t, string(inputJSON), string(outputJSON))
50-
}
51-
5212
func TestAppSyncIdentity_IAM(t *testing.T) {
5313
inputJSON, err := ioutil.ReadFile("./testdata/appsync-identity-iam.json")
5414
if err != nil {

events/testdata/appsync-batchinvoke.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

events/testdata/appsync-invoke.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)