12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271 |
- /*
- * EliasDB
- *
- * Copyright 2016 Matthias Ladkau. All rights reserved.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
- package interpreter
- import (
- "encoding/json"
- "testing"
- )
- func TestSortingAndLimiting(t *testing.T) {
- gm, _ := songGraphGroups()
- query := map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(ascending:"key") {
- key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "key": "Aria1",
- "name": "Aria1"
- },
- {
- "key": "Aria2",
- "name": "Aria2"
- },
- {
- "key": "Aria3",
- "name": "Aria3"
- },
- {
- "key": "Aria4",
- "name": "Aria4"
- },
- {
- "key": "DeadSong2",
- "name": "DeadSong2"
- },
- {
- "key": "FightSong4",
- "name": "FightSong4"
- },
- {
- "key": "LoveSong3",
- "name": "LoveSong3"
- },
- {
- "key": "MyOnlySong3",
- "name": "MyOnlySong3"
- },
- {
- "key": "StrangeSong1",
- "name": "StrangeSong1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(ascending:"name", last: 3) {
- key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "key": "LoveSong3",
- "name": "LoveSong3"
- },
- {
- "key": "MyOnlySong3",
- "name": "MyOnlySong3"
- },
- {
- "key": "StrangeSong1",
- "name": "StrangeSong1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(descending:"name", last: 3) {
- key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "key": "Aria3",
- "name": "Aria3"
- },
- {
- "key": "Aria2",
- "name": "Aria2"
- },
- {
- "key": "Aria1",
- "name": "Aria1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(ascending:"name", items: 2, last: 3) {
- key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "key": "LoveSong3",
- "name": "LoveSong3"
- },
- {
- "key": "MyOnlySong3",
- "name": "MyOnlySong3"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- // From the last 3 we retrieve item 1 and the next
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(ascending:"name", from : 1, items: 2, last: 3) {
- key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "key": "MyOnlySong3",
- "name": "MyOnlySong3"
- },
- {
- "key": "StrangeSong1",
- "name": "StrangeSong1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(ascending:"name", from : 100, items: 200, last: 2) {
- key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "key": "MyOnlySong3",
- "name": "MyOnlySong3"
- },
- {
- "key": "StrangeSong1",
- "name": "StrangeSong1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(ascending:"name", descending:"key") {
- key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": []
- },
- "errors": [
- {
- "locations": [
- {
- "column": 45,
- "line": 3
- }
- ],
- "message": "Cannot specify ascending and descending sorting",
- "path": [
- "Song"
- ]
- }
- ]
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(ascending:"hans") {
- key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "key": "StrangeSong1",
- "name": "StrangeSong1"
- },
- {
- "key": "FightSong4",
- "name": "FightSong4"
- },
- {
- "key": "DeadSong2",
- "name": "DeadSong2"
- },
- {
- "key": "LoveSong3",
- "name": "LoveSong3"
- },
- {
- "key": "MyOnlySong3",
- "name": "MyOnlySong3"
- },
- {
- "key": "Aria1",
- "name": "Aria1"
- },
- {
- "key": "Aria2",
- "name": "Aria2"
- },
- {
- "key": "Aria3",
- "name": "Aria3"
- },
- {
- "key": "Aria4",
- "name": "Aria4"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- }
- func TestFragments(t *testing.T) {
- gm, _ := songGraphGroups()
- // Test fragments for different return types
- query := map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(key : "StrangeSong1") {
- song_key : key
- foo : bar(traverse : ":::") {
- key
- kind
- ...groupFields
- ...authorFields @skip(if: false)
- }
- }
- }
- fragment groupFields on group {
- owner
- }
- fragment authorFields on Author {
- name
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "foo": [
- {
- "key": "123",
- "kind": "Author",
- "name": "Mike"
- },
- {
- "key": "Best",
- "kind": "group",
- "owner": "noowner"
- }
- ],
- "song_key": "StrangeSong1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- // Test fragments for different return types - now using inline fragments
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(key : "StrangeSong1") {
- song_key : key
- foo : bar(traverse : ":::") {
- key
- kind
- ... on group @skip(if: false) {
- owner
- }
- ... on Author {
- name
- }
- }
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "foo": [
- {
- "key": "123",
- "kind": "Author",
- "name": "Mike"
- },
- {
- "key": "Best",
- "kind": "group",
- "owner": "noowner"
- }
- ],
- "song_key": "StrangeSong1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- key
- name1 : name
- ...SongKind
- ...foo
- }
- fragment SongKind on Song {
- kind
- name2 : name
- key
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult("", query, gm); rerr == nil ||
- rerr.Error() != "Fatal GraphQL query error in test: Invalid construct (Fragment foo is not defined) (Line:2 Pos:2)" {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- key
- name1 : name
- ...SongKind
- ...foo
- }
- fragment SongKind on Song {
- kind
- name2 : name
- key
- }
- fragment SongKind on Song {
- kind
- name2 : name
- key
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult("", query, gm); rerr == nil ||
- rerr.Error() != "Fatal GraphQL query error in test: Ambiguous definition (Fragment SongKind defined multiple times) (Line:2 Pos:2)" {
- t.Error(rerr)
- return
- }
- }
- func TestMutation(t *testing.T) {
- gm, _ := songGraphGroups()
- query := map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(storeNode : {
- key:"newsongkey",
- name:"newsongname"
- }, key : "newsongkey") {
- key,
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": []
- },
- "errors": [
- {
- "locations": [
- {
- "column": 25,
- "line": 6
- }
- ],
- "message": "Operation must be a mutation to modify data",
- "path": [
- "Song"
- ]
- }
- ]
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- mutation {
- Song(storeNode : {
- key : "newsongkey",
- name : "newsongname"
- }, storeEdge : {
- key : "newedgekey",
- kind : "newedgekind"
- end1key : "newsongkey",
- end1kind : "Song",
- end1role : "song",
- end1cascading : false,
- end2key : "Best",
- end2kind : "group",
- end2role : "group",
- end2cascading : false,
- },key : "newsongkey") {
- key,
- name,
- group(traverse : ":::group") {
- key
- otherMembers(traverse : ":::Song", matches : {
- not_key : "newsongkey",
- name : "^.*Song[0-9]$"
- }) {
- key,
- kind,
- name,
- }
- }
- }
- }
- `,
- "variables": nil,
- }
- result, _ := runQuery("test", "main", query, gm, nil, true)
- actualResultBytes, _ := json.MarshalIndent(result, "", " ")
- actualResult := string(actualResultBytes)
- if actualResult != `{
- "data": {
- "Song": []
- },
- "errors": [
- {
- "locations": [
- {
- "column": 26,
- "line": 17
- }
- ],
- "message": "Can only perform read operations",
- "path": [
- "Song"
- ]
- }
- ]
- }` {
- t.Error("Unexpected result:", actualResult)
- return
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "group": [
- {
- "key": "Best",
- "otherMembers": [
- {
- "key": "LoveSong3",
- "kind": "Song",
- "name": "LoveSong3"
- },
- {
- "key": "MyOnlySong3",
- "kind": "Song",
- "name": "MyOnlySong3"
- },
- {
- "key": "StrangeSong1",
- "kind": "Song",
- "name": "StrangeSong1"
- }
- ]
- }
- ],
- "key": "newsongkey",
- "name": "newsongname"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- mutation {
- Song(removeNode : {
- key : "newsongkey",
- }, removeEdge : {
- key : "newedgekey",
- kind : "newedgekind"
- },key : "newsongkey") {
- key,
- name,
- group(traverse : ":::group") {
- key
- otherMembers(traverse : ":::Song", matches : {
- not_key : "newsongkey",
- name : "^.*Song[0-9]$"
- }) {
- key,
- kind,
- name,
- }
- }
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": []
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- mutation {
- Song(storeNode : "Hans", storeEdge : "Franz", key : "Honk") {
- key,
- name,
- }
- }`,
- "variables": nil,
- }
- if rerr := checkResult(`{
- "data": {
- "Song": []
- },
- "errors": [
- {
- "locations": [
- {
- "column": 64,
- "line": 3
- }
- ],
- "message": "Object required for node attributes and values",
- "path": [
- "Song"
- ]
- },
- {
- "locations": [
- {
- "column": 64,
- "line": 3
- }
- ],
- "message": "Object required for edge attributes and values",
- "path": [
- "Song"
- ]
- }
- ]
- }`, query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- mutation {
- Song(removeNode : "Hans", removeEdge : "Franz", key : "Honk") {
- key,
- name,
- }
- }`,
- "variables": nil,
- }
- if rerr := checkResult(`{
- "data": {
- "Song": []
- },
- "errors": [
- {
- "locations": [
- {
- "column": 66,
- "line": 3
- }
- ],
- "message": "Object required for node key and kind",
- "path": [
- "Song"
- ]
- },
- {
- "locations": [
- {
- "column": 66,
- "line": 3
- }
- ],
- "message": "Object required for edge key and kind",
- "path": [
- "Song"
- ]
- }
- ]
- }`, query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- }
- func TestTraversals(t *testing.T) {
- gm, _ := songGraphGroups()
- query := map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(key : "StrangeSong1") {
- song_key : key
- foo : bar(traverse : ":::") {
- key
- kind
- Name : name
- }
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "foo": [
- {
- "Name": "Mike",
- "key": "123",
- "kind": "Author"
- },
- {
- "Name": null,
- "key": "Best",
- "kind": "group"
- }
- ],
- "song_key": "StrangeSong1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(key : "StrangeSong1") {
- song_key : key
- foo : bar(traverse : ":::Author") {
- kind() {}
- }
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "foo": [
- {
- "kind": "Author"
- }
- ],
- "song_key": "StrangeSong1"
- }
- ]
- },
- "errors": [
- {
- "locations": [
- {
- "column": 9,
- "line": 6
- }
- ],
- "message": "Traversal argument is missing",
- "path": [
- "Song",
- ":::Author"
- ]
- }
- ]
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- }
- func TestListQueries(t *testing.T) {
- gm, _ := songGraphGroups()
- query := map[string]interface{}{
- "operationName": "foo",
- "query": `
- {
- Song {
- key
- }
- }
- `,
- "variables": nil,
- }
- _, err := runQuery("test", "main", query, gm, nil, false)
- if err == nil || err.Error() != "Fatal GraphQL operation error in test: Missing operation (Operation foo not found) (Line:2 Pos:2)" {
- t.Error("Unexpected result:", err)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- fragment friendFields on User {
- id
- name
- profilePic(size: 50)
- }
- `,
- "variables": nil,
- }
- res, err := runQuery("test", "main", query, gm, nil, false)
- if err == nil || err.Error() != "Fatal GraphQL operation error in test: Missing operation (No executable expression found) (Line:2 Pos:2)" {
- t.Error("Unexpected result:", res, err)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song1 : Song {
- song_key : key
- song_key1 : key
- song_key1 : name # This is illegal and will be ignored
- song_key1 : key
- name
- name
- }
- group {
- key
- },
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song1": [
- {
- "name": "StrangeSong1",
- "song_key": "StrangeSong1",
- "song_key1": "StrangeSong1"
- },
- {
- "name": "FightSong4",
- "song_key": "FightSong4",
- "song_key1": "FightSong4"
- },
- {
- "name": "DeadSong2",
- "song_key": "DeadSong2",
- "song_key1": "DeadSong2"
- },
- {
- "name": "LoveSong3",
- "song_key": "LoveSong3",
- "song_key1": "LoveSong3"
- },
- {
- "name": "MyOnlySong3",
- "song_key": "MyOnlySong3",
- "song_key1": "MyOnlySong3"
- },
- {
- "name": "Aria1",
- "song_key": "Aria1",
- "song_key1": "Aria1"
- },
- {
- "name": "Aria2",
- "song_key": "Aria2",
- "song_key1": "Aria2"
- },
- {
- "name": "Aria3",
- "song_key": "Aria3",
- "song_key1": "Aria3"
- },
- {
- "name": "Aria4",
- "song_key": "Aria4",
- "song_key1": "Aria4"
- }
- ],
- "group": [
- {
- "key": "Best"
- }
- ]
- },
- "errors": [
- {
- "locations": [
- {
- "column": 17,
- "line": 3
- }
- ],
- "message": "Field identifier song_key1 used multiple times",
- "path": [
- "Song1"
- ]
- },
- {
- "locations": [
- {
- "column": 17,
- "line": 3
- }
- ],
- "message": "Field identifier name used multiple times",
- "path": [
- "Song1"
- ]
- }
- ]
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(key : "StrangeSong1") {
- song_key : key
- name
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "name": "StrangeSong1",
- "song_key": "StrangeSong1"
- }
- ]
- }
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(matches : { name : "Aria[2-4]", not_name : "Aria4", foo : "a[" }) {
- song_key : key
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "song_key": "Aria2"
- },
- {
- "song_key": "Aria3"
- }
- ]
- },
- "errors": [
- {
- "locations": [
- {
- "column": 79,
- "line": 3
- }
- ],
- "message": "Regex a[ did not compile: error parsing regexp: missing closing ]: `[1:]+"`[`"+`",
- "path": [
- "Song"
- ]
- }
- ]
- }`, query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(matches : { name1 : "test" }) {
- song_key : key
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`{
- "data": {
- "Song": []
- }
- }`, query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- {
- Song(matches : [ "name1", "test" ]) {
- }
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`{
- "data": {
- "Song": [
- {},
- {},
- {},
- {},
- {},
- {},
- {},
- {},
- {}
- ]
- },
- "errors": [
- {
- "locations": [
- {
- "column": 45,
- "line": 3
- }
- ],
- "message": "Matches expression is not a map",
- "path": [
- "Song"
- ]
- }
- ]
- }`, query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- query = map[string]interface{}{
- "operationName": nil,
- "query": `
- fragment Song on Song {
- key
- name1 : name
- ...SongKind
- }
- query b { # This should be executed
- Song {
- key
- ...Song
- }
- }
- query a {
- Song1 {
- key1
- }
- }
- fragment SongKind on Song {
- kind
- name2 : name
- key
- }
- `,
- "variables": nil,
- }
- if rerr := checkResult(`
- {
- "data": {
- "Song": [
- {
- "key": "StrangeSong1",
- "kind": "Song",
- "name1": "StrangeSong1",
- "name2": "StrangeSong1"
- },
- {
- "key": "FightSong4",
- "kind": "Song",
- "name1": "FightSong4",
- "name2": "FightSong4"
- },
- {
- "key": "DeadSong2",
- "kind": "Song",
- "name1": "DeadSong2",
- "name2": "DeadSong2"
- },
- {
- "key": "LoveSong3",
- "kind": "Song",
- "name1": "LoveSong3",
- "name2": "LoveSong3"
- },
- {
- "key": "MyOnlySong3",
- "kind": "Song",
- "name1": "MyOnlySong3",
- "name2": "MyOnlySong3"
- },
- {
- "key": "Aria1",
- "kind": "Song",
- "name1": "Aria1",
- "name2": "Aria1"
- },
- {
- "key": "Aria2",
- "kind": "Song",
- "name1": "Aria2",
- "name2": "Aria2"
- },
- {
- "key": "Aria3",
- "kind": "Song",
- "name1": "Aria3",
- "name2": "Aria3"
- },
- {
- "key": "Aria4",
- "kind": "Song",
- "name1": "Aria4",
- "name2": "Aria4"
- }
- ]
- },
- "errors": [
- {
- "locations": [
- {
- "column": 9,
- "line": 8
- }
- ],
- "message": "Field identifier key used multiple times",
- "path": [
- "Song"
- ]
- }
- ]
- }`[1:], query, gm); rerr != nil {
- t.Error(rerr)
- return
- }
- }
|