Cannot use "connect" relational argument as shown in documentation

I’m attempting to follow the example shown here to connect documents:

I can successfully create and “overwrite” existing “BenchmarkDataset” values using these 2 mutations:

mutation addBenchmarkSetsToHWID{
  updateUserMachineID(id: "284565837174538755", data:{
    HardwareID: "{1}"
    BenchmarkDatasets: 284553267109691906
  })
  {
    _id
  }

}

#"284553243334279686"

mutation connectDataToHWID{
  createUserMachineID(data: {
		HardwareID: "{1}"
    BenchmarkDatasets: "284553267109691906"
    
  }){
  	HardwareID
  }
}

But whenever I attempt to use “connect” as shown to append an additional “BenchmarkDataset” to a “UserMachineID”, I get an error:

I can provide my types if needed, but I’m assuming I’m just missing something obvious. All help is greatly appreciated.

Hey Fauna team,

I hate to be so needy, but I have not yet been able to figure out this issue and am hoping to go live with my site using this data this coming Monday.

Hey, I’m not to familiar with the GraphQL side of Fauna, but just had a quick look at the docs. I think it would help if you provided the types.

Ok, no problem. Here’s the entire schema.

type MetaData @embedded { 
    SysLatVersion: String!
    RTSSVersion: String!
    StartTimeUTC: String!
    EndTimeUTC: String!
    StartTimeLocal: String!
    EndTimeLocal: String!
    TargetApplication: String!
    NumProcBegin: Int
    NumProcEnd: Int
    ProcListBegin: [String]
    ProcListEnd: [String]
    NumServBegin: Int
    NumServEnd: Int
    ServListBegin: [String]
    ServListEnd: [String]
}

type AggregateData @embedded { 
    EVRCounter: Int!
    EVRSystemLatencyTotal: Int!
    EVRsystemLatencyAverage: Float!
    SysLatTestCount: Int!
    SystemLatencyTotal: Int!
    SystemLatencyAverage: Float!
}

type SysLatData @embedded {
    SysLatResultSize: [ Int! ] 
    SysLatResults: [ Int! ] 
    ActiveWindow: [ String! ]
	RTSSWindow: [ String! ]
}

type BenchmarkDataset { 
    MetaData: MetaData!
    AggregateData: AggregateData!
    SysLatData: SysLatData!
    UserMachineID: UserMachineID
    UserMachineInfo: UserMachineInfo
}

type UserMachineID{
    BenchmarkDatasets: [BenchmarkDataset!]
    HardwareID: String @unique
    MACAddress: String
    IPAddress: String
    MachineSID: String
    UserProfileName: String
}

type UserMachineInfo{
    UserMachineID: UserMachineID
    BenchmarkDatasets: [BenchmarkDataset!]
    OperatingSystem: String!
    CPU: String!
    Videocard: String
    Drive: String
    Memory: String
    Motherboard: String!
    DisplayMonitor: String
}

type Query {   
    BenchmarkDatasets: [BenchmarkDataset!]
    UserMachineIDbyHWID(HardwareID: String): UserMachineID
    BenchmarkDatasetsByHWID(UserMachineID: UserMachineID): [BenchmarkDataset!]
    UserMachineIDs: [UserMachineID!]
    UserMachineInfos: [UserMachineInfo!]
}

It certainly isn’t set in stone, so if you have any other recommendations about how I might want to set up my data before I’m “locked-in”, I’m definitely listening.
Thanks.

Thanks. So as far as I understand you need the @relation directive to be able to use connect. I’m not sure if this appends an item in an array or creates a join table of some sort.

Ok, I’ll give that a shot. I probably should’ve tried that already, but I I believe I read something that said that “relation” is implicit, unless the relationship was unknowable.

I am unable to load your schema file.

As @eigilsagafos mentioned, you should use the @relation directive and behind the scenes, it creates an Index to establish a one-to-many relationships.

My apologies, I uploaded a schema that I was playing around with. I should’ve checked that it was able to load before I posted it.
Here it is again, but corrected to remove the incorrect query, and now use the @relation directive.

type MetaData @embedded { 
    SysLatVersion: String!
    RTSSVersion: String!
    StartTimeUTC: String!
    EndTimeUTC: String!
    StartTimeLocal: String!
    EndTimeLocal: String!
    TargetApplication: String!
    NumProcBegin: Int
    NumProcEnd: Int
    ProcListBegin: [String]
    ProcListEnd: [String]
    NumServBegin: Int
    NumServEnd: Int
    ServListBegin: [String]
    ServListEnd: [String]
}

type AggregateData @embedded { 
    EVRCounter: Int!
    EVRSystemLatencyTotal: Int!
    EVRsystemLatencyAverage: Float!
    SysLatTestCount: Int!
    SystemLatencyTotal: Int!
    SystemLatencyAverage: Float!
}

type SysLatData @embedded {
    SysLatResultSize: [ Int! ] 
    SysLatResults: [ Int! ] 
    ActiveWindow: [ String! ]
	RTSSWindow: [ String! ]
}

type BenchmarkDataset { 
    MetaData: MetaData!
    AggregateData: AggregateData!
    SysLatData: SysLatData!
    UserMachineID: UserMachineID @relation(name: "dataSetOwnerHWID")
    UserMachineInfo: UserMachineInfo @relation(name: "dataSetOwnerMI")
}

type UserMachineID{
    BenchmarkDatasets: [BenchmarkDataset!] @relation(name: "dataSetOwnerHWID")
    UserMachineInfo: UserMachineInfo @relation(name: "MI_HWID")
    HardwareID: String @unique
    MACAddress: String
    IPAddress: String
    MachineSID: String
    UserProfileName: String
}

type UserMachineInfo{
    UserMachineID: UserMachineID @relation(name: "MI_HWID")
    BenchmarkDatasets: [BenchmarkDataset!] @relation(name: "dataSetOwnerMI")
    OperatingSystem: String!
    CPU: String!
    Videocard: String
    Drive: String
    Memory: String
    Motherboard: String!
    DisplayMonitor: String
}

type Query {   
    BenchmarkDatasets: [BenchmarkDataset!]
    UserMachineIDbyHWID(HardwareID: String): UserMachineID
    UserMachineIDs: [UserMachineID!]
    UserMachineInfos: [UserMachineInfo!]
}

Sadly, I am still having issues when attempting to use connect to “append” a “BenchmarkDataset” to a “UserMachineID”.

Nevermind! It works!

It’s beautiful!