在Graphcool被停用的情况下,我一直在尝试让react-admin与Fauna一起工作,但是没有成功。 Fauna GraphQL语法与Graphcool不同,当然,当我连接到Fauna DB时,它无法识别任何资源。
如果我通过上传以下GraphQL模式来构建非常简单的动物区系数据库:
type Location {
name: String!
address1: String!
address2: String
city: String
state: String
zip: String
}
type Query {
allLocations: [ Location ]
}
Fauna创建的最终模式如下:
directive @embedded on OBJECT
directive @collection(name: String!) on OBJECT
directive @index(name: String!) on FIELD_DEFINITION
directive @resolver(
name: String
paginated: Boolean! = false
) on FIELD_DEFINITION
directive @relation(name: String) on FIELD_DEFINITION
directive @unique(index: String) on FIELD_DEFINITION
scalar Date
type Location {
city: String
name: String!
zip: String
state: String
_id: ID!
address2: String
address1: String!
_ts: Long!
}
input LocationInput {
name: String!
address1: String!
address2: String
city: String
state: String
zip: String
}
type LocationPage {
data: [Location]!
after: String
before: String
}
scalar Long
type Mutation {
createLocation(data: LocationInput!): Location!
updateLocation(
id: ID!
data: LocationInput!
): Location
deleteLocation(id: ID!): Location
}
type Query {
findLocationByID(id: ID!): Location
allLocations(
_size: Int
_cursor: String
): LocationPage!
}
scalar Time
我很难弄清楚如何调整Graphcool / GraphQL数据提供程序以解决Fauna语法中的差异。我注意到了一些区别:
_id
,但ra-data-graphcool希望它们为id
Graphcool数据提供程序构建gql以获取记录列表的方式也可能存在差异。是否有人为Fauna创建或修改了数据提供程序(或者也许是Back4App或其他免费/廉价的云GraphQL提供程序)?