Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to use declarative types with @graphql-tools/schema #362

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

salma-bek
Copy link
Member

The purpose of this PR is to use declarative types with @graphql-tools/schema instead of GraphQL’s reference implementation

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 13, 2024
Copy link
Contributor

@gvenzl gvenzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @salma-bek,

Please solve the merge conflicts so that we can merge this change.

const getBooks = async (SEARCH_URL) => {
import { makeExecutableSchema } from 'graphql-tools-schema';
import 'mle-js-fetch';
import oracledb from 'mle-js-oracledb';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might no longer be necessary to import oracledb. Instead of

const connection = oracledb.defaultConnection();
const result = connection.execute()

you can simply reference the session object in the global scope. This will make it easier later on to bundle the code. Unless of course something else in the oracledb namespace is needed that MLE doesn't provide in the global scope.

},
Book: {
stock: async (book) => {
const conn = oracledb.defaultConnection();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please consider using session.execute() here.

},
};

const getBooks = async (SEARCH_URL) => {
const conn = oracledb.defaultConnection();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please consider using session.execute() instead

`);

const response = await fetch(`${BASE_URL}${SEARCH_URL}`, { credentials: "include" });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beginning with Oracle Database 23.3 it should no longer be necessary to use createntials: include

@martin-bach-oracle
Copy link

In addition to the comments in the code, please add instructions how to use rollup to generate a bundle of graphql-tools and your code.

Copy link

@martin-bach-oracle martin-bach-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly address the outstanding comments and resubmit the code for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants