-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): support storytelling (#553)
- Loading branch information
1 parent
0738b7e
commit f9b3105
Showing
46 changed files
with
16,125 additions
and
4,271 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package e2e | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/gavv/httpexpect/v2" | ||
) | ||
|
||
func addLayerItemFromPrimitive(e *httpexpect.Expect, rootLayerId string) (GraphQLRequest, *httpexpect.Value, string) { | ||
requestBody := GraphQLRequest{ | ||
OperationName: "AddLayerItemFromPrimitive", | ||
Query: `mutation AddLayerItemFromPrimitive($parentLayerId: ID!, $pluginId: ID!, $extensionId: ID!, $name: String, $lat: Float, $lng: Float, $index: Int) { | ||
addLayerItem( input: {parentLayerId: $parentLayerId, pluginId: $pluginId, extensionId: $extensionId, name: $name, lat: $lat, lng: $lng, index: $index}) { | ||
parentLayer { | ||
id | ||
} | ||
layer { | ||
id | ||
} | ||
} | ||
}`, | ||
Variables: map[string]any{ | ||
"parentLayerId": rootLayerId, | ||
"pluginId": "reearth", | ||
"extensionId": "marker", | ||
"name": "Marker", | ||
"lat": 30.00000000000000, | ||
"lng": 40.00000000000000, | ||
"lang": "en-US", | ||
"index": 0, | ||
}, | ||
} | ||
|
||
res := e.POST("/api/graphql"). | ||
WithHeader("Origin", "https://example.com"). | ||
WithHeader("X-Reearth-Debug-User", uID.String()). | ||
WithHeader("Content-Type", "application/json"). | ||
WithJSON(requestBody). | ||
Expect(). | ||
Status(http.StatusOK). | ||
JSON() | ||
|
||
return requestBody, res, res.Path("$.data.addLayerItem.layer.id").Raw().(string) | ||
} |
Oops, something went wrong.