Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions packages/graphql/src/schema/augment/fulltext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ import { FloatWhere } from "../../graphql/input-objects/FloatWhere";
import { upperFirst } from "../../utils/upper-first";
import { fulltextResolver } from "../resolvers/query/fulltext";

export const fulltextArgDeprecationMessage =
"This argument has been deprecated and will be removed in future versions of the library. " +
"Please use the top-level query that corresponds to the index you wish to query instead. " +
"More information about the changes to @fulltext can be found here: " +
"https://neo4j.com/docs/graphql-manual/current/guides/v4-migration/#_fulltext_changes.";

export function augmentFulltextSchema(
node: Node,
composer: SchemaComposer,
Expand Down
11 changes: 2 additions & 9 deletions packages/graphql/src/schema/resolvers/query/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import type { Node } from "../../../classes";
import type { Context } from "../../../types";
import { translateAggregate } from "../../../translate";
import getNeo4jResolveTree from "../../../utils/get-neo4j-resolve-tree";
import { fulltextArgDeprecationMessage } from "../../../schema/augment/fulltext";

export function aggregateResolver({ node }: { node: Node }) {
async function resolve(_root: any, _args: any, _context: unknown, info: GraphQLResolveInfo) {
Expand Down Expand Up @@ -57,14 +56,8 @@ export function aggregateResolver({ node }: { node: Node }) {
? {
fulltext: {
type: `${node.name}Fulltext`,
directives: [
{
name: "deprecated",
args: {
reason: fulltextArgDeprecationMessage,
},
},
],
description:
"Query a full-text index. Allows for the aggregation of results, but does not return the query score. Use the root full-text query fields if you require the score.",
},
}
: {}),
Expand Down
2 changes: 2 additions & 0 deletions packages/graphql/src/schema/resolvers/query/fulltext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export function fulltextResolver(

return {
type: `[${node.fulltextTypeNames.result}!]!`,
description:
"Query a full-text index. This query returns the query score, but does not allow for aggregations. Use the `fulltext` argument under other queries for this functionality.",
resolve,
args: {
phrase: "String!",
Expand Down
11 changes: 2 additions & 9 deletions packages/graphql/src/schema/resolvers/query/read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { translateRead } from "../../../translate";
import type { Node } from "../../../classes";
import type { Context } from "../../../types";
import getNeo4jResolveTree from "../../../utils/get-neo4j-resolve-tree";
import { fulltextArgDeprecationMessage } from "../../../schema/augment/fulltext";

export function findResolver({ node }: { node: Node }) {
async function resolve(_root: any, args: any, _context: unknown, info: GraphQLResolveInfo) {
Expand Down Expand Up @@ -52,14 +51,8 @@ export function findResolver({ node }: { node: Node }) {
? {
fulltext: {
type: `${node.name}Fulltext`,
directives: [
{
name: "deprecated",
args: {
reason: fulltextArgDeprecationMessage,
},
},
],
description:
"Query a full-text index. Allows for the aggregation of results, but does not return the query score. Use the root full-text query fields if you require the score.",
},
}
: {}),
Expand Down
11 changes: 2 additions & 9 deletions packages/graphql/src/schema/resolvers/query/root-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import type { Context } from "../../../types";
import getNeo4jResolveTree from "../../../utils/get-neo4j-resolve-tree";
import { isNeoInt } from "../../../utils/utils";
import { createConnectionWithEdgeProperties } from "../../pagination";
import { fulltextArgDeprecationMessage } from "../../../schema/augment/fulltext";
import { graphqlDirectivesToCompose } from "../../to-compose";

export function rootConnectionResolver({ node, composer }: { node: Node; composer: SchemaComposer }) {
Expand Down Expand Up @@ -120,14 +119,8 @@ export function rootConnectionResolver({ node, composer }: { node: Node; compose
? {
fulltext: {
type: `${node.name}Fulltext`,
directives: [
{
name: "deprecated",
args: {
reason: fulltextArgDeprecationMessage,
},
},
],
description:
"Query a full-text index. Allows for the aggregation of results, but does not return the query score. Use the root full-text query fields if you require the score.",
},
}
: {}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import type { Driver } from "neo4j-driver";
import { generate } from "randomstring";
import { graphql } from "graphql";
import { gql } from "graphql-tag";
import Neo4j from "../neo4j";
import { Neo4jGraphQL } from "../../../src/classes";
import { UniqueType } from "../../utils/graphql-types";
import { delay } from "../../../src/utils/utils";
import { isMultiDbUnsupportedError } from "../../utils/is-multi-db-unsupported-error";
import Neo4j from "../../neo4j";
import { Neo4jGraphQL } from "../../../../src/classes";
import { UniqueType } from "../../../utils/graphql-types";
import { delay } from "../../../../src/utils/utils";
import { isMultiDbUnsupportedError } from "../../../utils/is-multi-db-unsupported-error";

describe("@fulltext directive", () => {
let driver: Driver;
Expand Down
34 changes: 31 additions & 3 deletions packages/graphql/tests/schema/fulltext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,38 @@ describe("@fulltext schema", () => {
}

type Query {
movies(fulltext: MovieFulltext @deprecated(reason: \\"This argument has been deprecated and will be removed in future versions of the library. Please use the top-level query that corresponds to the index you wish to query instead. More information about the changes to @fulltext can be found here: https://neo4j.com/docs/graphql-manual/current/guides/v4-migration/#_fulltext_changes.\\"), options: MovieOptions, where: MovieWhere): [Movie!]!
moviesAggregate(fulltext: MovieFulltext @deprecated(reason: \\"This argument has been deprecated and will be removed in future versions of the library. Please use the top-level query that corresponds to the index you wish to query instead. More information about the changes to @fulltext can be found here: https://neo4j.com/docs/graphql-manual/current/guides/v4-migration/#_fulltext_changes.\\"), where: MovieWhere): MovieAggregateSelection!
moviesConnection(after: String, first: Int, fulltext: MovieFulltext @deprecated(reason: \\"This argument has been deprecated and will be removed in future versions of the library. Please use the top-level query that corresponds to the index you wish to query instead. More information about the changes to @fulltext can be found here: https://neo4j.com/docs/graphql-manual/current/guides/v4-migration/#_fulltext_changes.\\"), sort: [MovieSort], where: MovieWhere): MoviesConnection!
movies(
\\"\\"\\"
Query a full-text index. Allows for the aggregation of results, but does not return the query score. Use the root full-text query fields if you require the score.
\\"\\"\\"
fulltext: MovieFulltext
options: MovieOptions
where: MovieWhere
): [Movie!]!
moviesAggregate(
\\"\\"\\"
Query a full-text index. Allows for the aggregation of results, but does not return the query score. Use the root full-text query fields if you require the score.
\\"\\"\\"
fulltext: MovieFulltext
where: MovieWhere
): MovieAggregateSelection!
moviesConnection(
after: String
first: Int
\\"\\"\\"
Query a full-text index. Allows for the aggregation of results, but does not return the query score. Use the root full-text query fields if you require the score.
\\"\\"\\"
fulltext: MovieFulltext
sort: [MovieSort]
where: MovieWhere
): MoviesConnection!
\\"\\"\\"
Query a full-text index. This query returns the query score, but does not allow for aggregations. Use the \`fulltext\` argument under other queries for this functionality.
\\"\\"\\"
moviesFulltextMovieDescription(limit: Int, offset: Int, phrase: String!, sort: [MovieFulltextSort!], where: MovieFulltextWhere): [MovieFulltextResult!]!
\\"\\"\\"
Query a full-text index. This query returns the query score, but does not allow for aggregations. Use the \`fulltext\` argument under other queries for this functionality.
\\"\\"\\"
moviesFulltextMovieTitle(limit: Int, offset: Int, phrase: String!, sort: [MovieFulltextSort!], where: MovieFulltextWhere): [MovieFulltextResult!]!
}

Expand Down
1 change: 1 addition & 0 deletions packages/ogm/src/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ describe("generate", () => {

export type Query = {
__typename?: \\"Query\\";
/** Query a full-text index. This query returns the query score, but does not allow for aggregations. Use the \`fulltext\` argument under other queries for this functionality. */
usersFulltextUserName: Array<UserFulltextResult>;
users: Array<User>;
usersConnection: UsersConnection;
Expand Down