[catalog/queries][s]: optimized the way we query graphql so that we only use single query for dataset/resource pages. It also fixes some buggy behaviour of next.js described in https://github.com/vercel/next.js/issues/8563.
This commit is contained in:
@@ -17,7 +17,7 @@ export const GET_ORG_QUERY = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_DATAPACKAGE_QUERY = gql`
|
||||
export const GET_DATASET_QUERY = gql`
|
||||
query dataset($id: String) {
|
||||
dataset(id: $id) @rest(type: "Response", path: "package_show?{args}") {
|
||||
result {
|
||||
@@ -26,23 +26,6 @@ export const GET_DATAPACKAGE_QUERY = gql`
|
||||
size
|
||||
created: metadata_created
|
||||
updated: metadata_modified
|
||||
resources {
|
||||
name
|
||||
id
|
||||
title
|
||||
format
|
||||
size
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_RESOURCES_QUERY = gql`
|
||||
query dataset($id: String) {
|
||||
dataset(id: $id) @rest(type: "Response", path: "package_show?{args}") {
|
||||
result {
|
||||
name
|
||||
resources {
|
||||
name
|
||||
title
|
||||
@@ -53,6 +36,11 @@ export const GET_RESOURCES_QUERY = gql`
|
||||
updated: last_modified
|
||||
size
|
||||
}
|
||||
organization {
|
||||
name
|
||||
title
|
||||
image: image_url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,32 +120,6 @@ export const GET_PAGE_QUERY = gql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_DATASET_QUERY = gql`
|
||||
query dataset($id: String) {
|
||||
dataset(id: $id) @rest(type: "Response", path: "package_show?{args}") {
|
||||
result {
|
||||
name
|
||||
title
|
||||
size
|
||||
created: metadata_created
|
||||
updated: metadata_modified
|
||||
resources {
|
||||
name
|
||||
title
|
||||
format
|
||||
created
|
||||
updated: last_modified
|
||||
}
|
||||
organization {
|
||||
name
|
||||
title
|
||||
image: image_url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_POST_QUERY = gql`
|
||||
query post($slug: String) {
|
||||
post(slug: $slug)
|
||||
|
||||
Reference in New Issue
Block a user